Password reset email getting 530 5.7.1 Authentication required

白昼怎懂夜的黑 提交于 2020-03-18 05:23:02

问题


When I try to send a password reset email, I get the following error:

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

I'm not sure what's wrong here. I've looked at Stack Overflow and Laracasts and found similar problems. I've tried two different email addresses and servers. But I'm getting the same error.

Here's my .env file:

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

Here is my mail.php file:

'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',

Any ideas what I've got wrong here?


回答1:


I found that changing the .env file requires you to clear you config cache:

php artisan config:cache

This worked and now email is sending.



来源:https://stackoverflow.com/questions/40942881/password-reset-email-getting-530-5-7-1-authentication-required

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!