Laravel教程(三)Laravel发送邮件

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

19
down vote
accepted
I know it’s working for you now @Vantheman6 but this is what worked for me in case it’s the same for someone else.

I added to my .env file the details of the mail service I am using. So make sure the following details

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=MyPassword
in the .env file are accurate.

NOTE: Don’t forget to restart your server after editing the .env file so it will pick the new data that you put in there.

If you don’t restart your server, the .env file will still continue to present the old mail data to the app even though you have made changes which can cause this error.

here most important thing is that I created gmail application specific password(16 digit).

I need to reveal one more thing since no luck for any of configuration. That is, whenever I changed .env file need to run this command

php artisan config:cache
And this is most most most important because without this command laravel executes previous settings from it’s cache. It’s required me more than 10 hours to figure out.

Swift_TransportException in StreamBuffer.php line 265: Connection could not be established with host

你可能感兴趣的:(PHP,邮件,laravel)