简体   繁体   English

Laravel:无法使用 2 个可能的身份验证器在 SMTP 服务器上使用用户名进行身份验证

[英]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.

相关问题 Laravel,无法使用 3 个可能的身份验证器使用用户名“”在 SMTP 服务器上进行身份验证 - Laravel, Failed to authenticate on SMTP server with username "" using 3 possible authenticators 无法使用2个可能的身份验证器在SMTP服务器上使用用户名进行身份验证 - Failed to authenticate on SMTP server with username using 2 possible authenticators 使用 2 个可能的身份验证器在用户名“***”的 SMTP 服务器上进行身份验证失败 - Failed to authenticate on SMTP server with username “***” using 2 possible authenticators Swift_TransportException无法使用共享主机上的2个可能的身份验证器使用用户名email@domain.com在SMTP服务器上进行身份验证 - Swift_TransportException Failed to authenticate on SMTP server with username email@domain.com using 2 possible authenticators on shared host PHP Swift 邮件程序:无法使用 2 个可能的身份验证器在 SMTP 上进行身份验证 - PHP Swift mailer: Failed to authenticate on SMTP using 2 possible authenticators 使用 Laravel Jetstream 使用用户名在 SMTP 服务器上进行身份验证失败 - Failed to authenticate on SMTP server with username using Laravel Jetstream Laravel 无法使用用户名在 SMTP 服务器上进行身份验证 - Laravel Failed to authenticate on SMTP server with username 无法在 SMTP 服务器上进行身份验证 Laravel 6 - Failed to authenticate on SMTP server in Laravel 6 如何解决 Laravel SMTP 中 2 个可能的身份验证器错误 - How to resolve 2 possible authenticators error in Laravel SMTP Swift_TransportException无法使用用户名在SMTP服务器上进行身份验证 - Swift_TransportException Failed to authenticate on SMTP server with username
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM