php - Connection could not be established with host smtp.gmail.com Network is unreachable #101 error in Laravel email -
i trying send email laravel 5.1 system. can send emails localhost , unable send server. see 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 work on localhost. on server getting error,
swift_transportexception in streambuffer.php line 268: connection not established host smtp.gmail.com [network unreachable #101]
i try changing mail_port
587
465
, mail_encryption
tls
ssl
. geeitng same error. how can fix issue?
1.) clear cache on server after changing configuration in .env file.
php artisan cache:clear; php artisan config:cache;
and if error still comes
connection refused explicit , clear error message. means socket connection not established because remote end actively refused connect.
it's unlikely google blocking connection.
it's web hosting provider has firewall settings block outgoing connections on port 465, or blocking smtp gmail. 465 "wrong" port secure smtp, though used, , gmail listen there. try port 587 instead. if connection still refused, call host , ask them what's up.
Comments
Post a Comment