[英]Laravel :Failed to authenticate on SMTP server with username using 2 possible authenticators
I've configured to gmail SMTP server to send email.我已经配置到 gmail SMTP 服务器来发送电子邮件。 Account less secure app turned ON, also Recapture enabled.
帐户安全性较低的应用程序已打开,也启用了重新捕获。 Here is the mail.php configuration.
这是mail.php 配置。
This code working fine on local server.此代码在本地服务器上运行良好。 But when i tried to in godaddy server i saw the following Error :
但是当我尝试在 godaddy 服务器中时,我看到了以下错误:
(1/1) Swift_TransportException Failed to authenticate on SMTP server
with username "xxxx@gmail.com" using 2 possible authenticators in AuthHandler.php (line 181)
.env (mail part)
.env(邮件部分)
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=xxxx@gmail.com
MAIL_PASSWORD=xxxxxx
MAIL_ENCRYPTION=tls
Mail.php
邮件.php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'smtp.gmail.com'),
'port' => env('MAIL_PORT', 587),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'xxxx@gmail.com'),
'name' => env('MAIL_FROM_NAME', 'xxxx'),
],
'encryption' => env('MAIL_ENCRYPTION', 'TLS'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
What should I do now?我现在该怎么办?
This is an old thread, but my resolution was a bit different for the same error.这是一个旧线程,但是对于相同的错误,我的解决方案有点不同。 Turns out my Swift configuration is fine.
原来我的 Swift 配置很好。 The IP from my server was blocked by Google as suspicious.
我的服务器的 IP 被谷歌阻止为可疑。 I was able to clear it by visiting this link, then executing my mailer code from the server.
我可以通过访问此链接来清除它,然后从服务器执行我的邮件程序代码。 http://www.google.com/accounts/DisplayUnlockCaptcha
http://www.google.com/accounts/DisplayUnlockCaptcha
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.