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= email@example.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
ssl. But I am geeitng the same error. How can I fix this issue?
I solved my problem in cpanel using the code: