【问题标题】:Laravel - Failed to authenticate on SMTP server with usernameLaravel - 无法使用用户名在 SMTP 服务器上进行身份验证
【发布时间】:2020-06-11 18:47:17
【问题描述】:

使用 Laravel-5.8 发送通知,我收到此错误:

Failed to authenticate on SMTP server with username "noblemfd@gmail.com" using 3 possible authenticators. Authenticator LOGIN returned Expected response code 23 ▶
535 5.7.8  https://support.google.com/mail/?p=BadCredentials n13sm8684140wmd.21 - gsmtp
". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535-5.7.8 
Username and Password not accepted. Learn more at
535 5.7.8  https://support.google.com/mail/?p=BadCredentials n13sm8684140wmd.21 - gsmtp
". Authenticator XOAUTH2 returned Expected response code 250 but got code "535", with message "535-5.7.8 
Username and Password not accepted. Learn more at
535 5.7.8  https://support.google.com/mail/?p=BadCredentials n13sm8684140wmd.21 - gsmtp

以前还可以,但突然开始不正常了

这是我的 .env

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=noblemfd@gmail.com
MAIL_PASSWORD=****
MAIL_ENCRYPTION=ssl

我该怎么办?

谢谢

【问题讨论】:

标签: laravel


【解决方案1】:

我今天也遇到了同样的问题。几个月来,smtp 一直运行良好,但今天突然出现了同样的错误。

对于值得我简单解决的问题,在 google Account -> Security -> App passwords 中重新生成密码。

这不是第一次发生在我身上。也许这是某种谷歌保护......但我没有在任何地方找到证据。总之很烦人。

我想知道的是如何捕捉这种错误,以便我们及时进行干预。

【讨论】:

  • 在 Laravel 7 中遇到了同样的问题。Google 正在阻止连接。我使用了我的备用服务器,一切正常。
猜你喜欢
  • 2019-03-11
  • 2018-01-13
  • 2019-10-06
  • 2020-01-12
  • 2021-06-11
  • 1970-01-01
  • 1970-01-01
  • 2019-01-20
  • 2020-08-07
相关资源
最近更新 更多