Script Sending mails with Gmail: Failed to authenticate on SMTP server

前端 未结 3 1596
清歌不尽
清歌不尽 2021-01-02 03:57

I am having some hard time getting my PHP script to send emails with a SMTP Gmail account. I am using PHP and Symfony2 SwiftMailer, but it seems that the problem lies with

3条回答
  •  孤独总比滥情好
    2021-01-02 04:17

    Using the link https://www.google.com/settings/security/lesssecureapps gave me the message: this setting is disabled by your administrator.

    I had to go to admin.google.com and login with the same account details and look for the same setting there. Full url was https://admin.google.com/AdminHome#ServiceSettings/notab=1&service=securitysetting&subtab=lesssecureappsaccess

    Then the first link worked, so also there I enabled less secure apps. Now I was able to use Gmails SMTP.

提交回复
热议问题