PHPMailer saying could not connect to SMTP host

前端 未结 4 1520
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-24 09:30

For the past 2 days I\'ve been trying to get a PHP script to send an e-mail and it doesn\'t seem to work. First I\'ve tried the normal php mail function, then PHPMailer and then

4条回答
  •  野性不改
    2021-01-24 09:38

    The same problem I had using Gmail and I solved it by downloading the cacert.pem certificate from the site https://curl.haxx.se/docs/caextract.html You should also write the php.ini file as follows:

    extension = php_openssl.dll openssl.cafile = C: \ xampp \ php \ extras \ ssl \ cacert.pem

    It must be activated in the GMail account in the label: Access and security of the option: Allow less secure apps access option: ON

    This solution is thanks to matteobin user contribution, of stackoverflow

提交回复
热议问题