vendredi 3 août 2018

Laravel 5.1 error email sending gmail works on local but not on server

I am having an error on Laravel email sending. I am using gmail as my mail driver. Everything works on local but it's a different story on dev server.

The server is Ubuntu 16.04 and Apache web server. I tried logging errors on laravel logs but to no avail.

Here's the error.

enter image description here

And here's the code block that's giving the error.

Mail::send(['text' => 'pages/reset-password-mail'], ['name' => 'Test', 'url' => $url], function($message) use ($email) {
     $message->to($email, $name = NULL)->subject('Reset Password');
     $message->from('test@gmail.com', 'Support');});

I have this in .env file

MAIL_DRIVER=smtp 
MAIL_HOST=smtp.googlemail.com 
MAIL_PORT=465 
MAIL_USERNAME=gmail username
MAIL_PASSWORD=gmail password
MAIL_ENCRYPTION=ssl

Any help would be greatly appreciated. TIA!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire