PHP Fatal error: 'Swift_TransportException' with message 'Failed to authenticate on SMTP server

懵懂的女人 提交于 2019-11-28 08:49:51

This is an old thread, but my resolution was a bit different for the same error. Turns out my Swift configuration is fine. The IP from my server was blocked by Google as suspicious. I was able to clear it by visiting this link, then executing my mailer code from the server.

http://www.google.com/accounts/DisplayUnlockCaptcha

You can also check that the 2 steps validation authentication is not enabled. This was the case for me.

Welcome to SO. This is more a lengthy comment than an answer. It's great to see you've posted your error message:

PHP Fatal error: Uncaught exception 'Swift_TransportException' with message 'Failed to authenticate on SMTP server with username "xxx@gmail.comm" using 2 possible authenticators' in /home/TestMail/SwiftMail/lib/classes/Swift/Transport/Esmtp/AuthHandler.php:171

Part of it is the actual message :

Failed to authenticate on SMTP server with username "xxx@gmail.comm" using 2 possible authenticators

I'd say that is a typo you made:

xxx@gmail.comm
             ^

Can happen. Please verify you're using the right login credentials. Also even if you find similar looking questions on site, it must not mean they cover your problem.

Hopefully this helps, otherwise try to provide more error information, e.g. is there a log with swiftmailer? Have you double checked the credentials and the server configuration? What's the firewall doing? And so on and so forth.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!