【发布时间】:2021-09-28 06:04:01
【问题描述】:
在 Laravel 7 中,我想使用 Office365 从我的应用程序发送电子邮件,尝试了电子邮件密码和应用程序密码均无效。
MAIL_MAILER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=my-email-here
MAIL_PASSWORD=my-email-password-here
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=my-email-here
MAIL_FROM_NAME="App name"
在上面的代码中 MAIL_PASSWORD 是我的电子邮件密码而不是应用程序密码 这个配置给了我以下错误
Failed to authenticate on SMTP server with username "support@tingsapp.com" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "451", with message "451 4.7.0 Temporary server error. Please try again later. PRX4 [MRXP264CA0044.FRAP264.PROD.OUTLOOK.COM]
". Authenticator XOAUTH2 returned Expected response code 235 but got code "535", with message "535 5.7.3 Authentication unsuccessful [MRXP264CA0044.FRAP264.PROD.OUTLOOK.COM]
在第二次尝试中,我将在 office.com 中创建的应用密码设置为 MAIL_PASSWORD 值,但我得到了同样的错误。
更改 .env 后,我运行 php artisan cache:clear 和 php artisan config:cache
请问有什么遗漏的吗
【问题讨论】:
标签: php laravel email office365