0
votes

When I try to use Gmail SMTP for sending email via Laravel, I encounter the following error:

Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)

It is the trace of the error

set_error_handler(function ($type, $msg) {
    throw new Swift_TransportException('Connection could not be established with host '.$this->params['host'].' :'.$msg);
});
1
Do you have the openssl extension enabled? - RiggsFolly
This can sometimes be because something is blocking the destination site! Could your firewall be getting in the way? - RiggsFolly
Yes OpenSSL is enabled - satyam verme
OpenSSL 1.1.1 11 Sep 2018 - satyam verme

1 Answers

0
votes

you need set the email config . enter this commands into your terminal

php artisan view:clear
php artisan route:clear
php artisan cache:clear
php artisan config:clear

php artisan config:cache