【问题标题】:Password reset email getting 530 5.7.1 Authentication required密码重置电子邮件收到 530 5.7.1 需要身份验证
【发布时间】:2017-04-17 23:51:41
【问题描述】:

当我尝试发送密码重置电子邮件时,我收到以下错误:

Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required"

我不确定这里出了什么问题。我查看了 Stack Overflow 和 Laracasts 并发现了类似的问题。我尝试了两个不同的电子邮件地址和服务器。但我遇到了同样的错误。

这是我的 .env 文件:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=xx@gmail.com
MAIL_PASSWORD=[password]
MAIL_ENCRYPTION=tls

这是我的 mail.php 文件:

'driver' => env('MAIL_DRIVER'),
'host' => env('MAIL_HOST'),
'port' => env('MAIL_PORT'),
'from' => [
   'address' => 'xx@gmail.com',
   'name' => 'XX',
],
'encryption' => env('MAIL_ENCRYPTION'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',

有什么想法我在这里做错了吗?

【问题讨论】:

  • 你在 bootstrap/cache/config.php 中检查过你的信用吗?
  • 我的 bootstrap/cache 文件夹中没有 config.php。
  • @ceejayoz - 它不是重复的,因为它不是 gmail 的问题。这是发送邮件的问题。我正在使用 Gmail,但正如我在帖子开头所说的那样,我尝试了 2 个不同的电子邮件地址和服务器。
  • @jerauf 您是否也从非 Gmail 邮件服务器获得了“需要 530 身份验证”?您尝试使用的第二个邮件提供商是什么?

标签: laravel laravel-5.3


【解决方案1】:

我发现更改 .env 文件需要您清除配置缓存:

php artisan config:cache

这有效,现在正在发送电子邮件。

【讨论】:

  • 你对我很有品味,兄弟!希望我能接受你的回答
  • 点赞!我是一个尝试 php artisan clear:cache 的傻瓜。它是 CONFIG:CACHE!
猜你喜欢
  • 1970-01-01
  • 2012-07-28
  • 2018-06-28
  • 2021-11-21
  • 1970-01-01
  • 1970-01-01
  • 2014-01-13
  • 2019-07-13
  • 1970-01-01
相关资源
最近更新 更多