vendredi 28 juillet 2017

Connection could not be established with host smtp.gmail.com Network is unreachable #101 error in Laravel email

I am trying to send email from my laravel 5.1 system. I can send emails from my localhost and unable to send from the server. See my email configuration settings in .env file,

MAIL_DRIVER=smtp
MAIL_HOST= smtp.gmail.com
MAIL_PORT= 587
MAIL_USERNAME= username***@gmail.com
MAIL_PASSWORD= *********
MAIL_ENCRYPTION=tls

This configuration only work on my localhost. On server I am getting this error,

Swift_TransportException in StreamBuffer.php line 268:
Connection could not be established with host smtp.gmail.com [Network is unreachable #101]

I also try with changing MAIL_PORT from 587 to 465 and MAIL_ENCRYPTION from tls to ssl. But I am geeitng the same error. How can I fix this issue?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire