Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection to tcp://smtp.mail.yahoo.com:465 Timed Out

Tags:

I'm really struggling with this error :

Swift_TransportException in AbstractSmtpTransport.php line 404: Connection to tcp://smtp.mail.yahoo.com:465 Timed Out

I hope someone can shed some light on this.

Here are my settings in my .env file

MAIL_DRIVER=smtp MAIL_HOST=smtp.mail.yahoo.com MAIL_PORT=465 [email protected] MAIL_PASSWORD=****** 
like image 829
code-8 Avatar asked Jul 13 '16 01:07

code-8


2 Answers

I notice in /config/mail.php , I see

'encryption' => env('MAIL_ENCRYPTION', 'tls'),

By updating it to

'encryption' => env('MAIL_ENCRYPTION', 'ssl'),

Now, it is working fine. My email is sending out now.

like image 141
code-8 Avatar answered Sep 19 '22 17:09

code-8


With Laravel 6.x ,7.x and 8.x

it is advisable to use SSL over the default tls.

Most shared hosting providers sign emails with SSL so edit your .env file to have this

MAIL_ENCRYPTION=ssl 
like image 24
Barungi Stephen Avatar answered Sep 20 '22 17:09

Barungi Stephen