PEAR Mail unable to connect to Gmail SMTP, failed to connect to socket

后端 未结 8 1668
广开言路
广开言路 2020-12-11 00:51

Facts

I am using PEAR Mail, I want to use gmail SMTP to send a mail. I have Apache/2.4.27 (Win64) PHP/7.2.0beta3, PEAR 1.10.15, Mail 1.4.1, Net_SMT

8条回答
  •  失恋的感觉
    2020-12-11 01:38

    Before I begin, let me preface this that there are many possibly solutions and outcomes between your server and the google server, so these may or may not work for different people.

    1) SMTP is not very secure, so Google may be rejecting your request. I had this problem 6 months ago and the solution was enabling insecure apps under 'myaccount.google.com'

    2) If that doesn't work for you then you may consider switching protocols.

    from

    'host' => 'ssl://smtp.gmail.com',

    to

    'host' => 'tls://smtp.gmail.com:587';

提交回复
热议问题