简体   繁体   中英

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
MAIL_USERNAME=dev.email@yahoo.com
MAIL_PASSWORD=******

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.

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

Just Use MAIL_ENCRYPTION=tls to MAIL_ENCRYPTION=ssl

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mail.yahoo.com
MAIL_PORT=465
MAIL_USERNAME=dev.email@yahoo.com
MAIL_PASSWORD=******
MAIL_ENCRYPTION=ssl

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM