Laravel电子邮件未发送,原因是无法使用用户名在SMTP服务器上进行身份验证



当我从localhost发送邮件时,我遇到了一个问题,一切都很好,但当从服务器发送时,我没有收到邮件,并且我收到了一个错误无法使用用户名在SMTP服务器上进行身份验证请帮助我如何解决此问题?谢谢

请检查错误,谢谢。

https://flareapp.io/share/RmrlNRN7

Swift_TransportException
Failed to authenticate on SMTP server with username "zubair.bhw@gmail.com" using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "534", with message "534-5.7.9 Application-specific password required. Learn more at 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor c25sm22236461edt.0 - gsmtp ". Authenticator PLAIN returned Expected response code 235 but got code "534", with message "534-5.7.9 Application-specific password required. Learn more at 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor c25sm22236461edt.0 - 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 c25sm22236461edt.0 - gsmtp ".
https

.env

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=zubair.bhw@gmail.com
MAIL_PASSWORD='12345678'  
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=zubair.bhw@gmail.com
MAIL_FROM_NAME="${APP_NAME}"
MALE_TO=zubair.bhw@gmail.com
  • 尝试端口465而不是587,因为Gmail通常使用该端口。检查是否您的实时服务器上的端口被阻止。登录您的gmail帐户(mygmail@gmail.com(。转到https://myaccount.google.com/security,向下滚动至页面底部。在右边你会看到:允许更少安全应用程序,请确保该选项处于启用状态

最新更新