code-8
code-8

Reputation: 58702

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

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=******

Upvotes: 29

Views: 49165

Answers (3)

Barungi Stephen
Barungi Stephen

Reputation: 847

With Laravel 6.x ,7.x , 8.x and 9.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

Upvotes: 20

Saad Hassan
Saad Hassan

Reputation: 29

Just Use MAIL_ENCRYPTION=tls to MAIL_ENCRYPTION=ssl

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mail.yahoo.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=******
MAIL_ENCRYPTION=ssl

Upvotes: 0

code-8
code-8

Reputation: 58702

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.

Upvotes: 100

Related Questions