8

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?

jerauf
  • 503
  • 1
  • 6
  • 14
  • Looks like http://stackoverflow.com/questions/17227532/gmail-530-5-5-1-authentication-required-learn-more-at – ceejayoz Dec 03 '16 at 00:28
  • did you check your creds in bootstrap/cache/config.php ? – Adrianopolis Dec 03 '16 at 00:36
  • There's no config.php in my bootstrap/cache folder. – jerauf Dec 03 '16 at 00:39
  • @ceejayoz - It's not duplicate because it's not a problem with gmail. It's a problem with sending mail. I'm using Gmail but as I said at the beginning of my post, I've tried 2 different email addresses and servers. – jerauf Dec 03 '16 at 00:40
  • @jerauf And you get an "530 authentication required" from the non-Gmail mail server, as well? What's the second mail provider you're attempting with? – ceejayoz Dec 03 '16 at 00:41
  • Yes. It's Media Temple's. – jerauf Dec 03 '16 at 00:49

1 Answers1

26

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.

jerauf
  • 503
  • 1
  • 6
  • 14