We have changed the email server from a provider to another. The where sending with the old email settings but not with the new ones. I am not sure if it`s laravel server or email server.
I will use here my domain as: example.com
I have changed the new email settings in .env:
MAIL_DRIVER=smtp
MAIL_HOST=server.example.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=ssl
and when we send emails we get this exception in laravel.log
production.ERROR: Connection to tcp://server.example.com:465 Timed Out {"exception":"[object] (Swift_TransportException(code: 0): Connection to tcp://server.example.com:465 Timed Out at /var/www/example.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:473, Swift_IoException(code: 0): Connection to tcp://server.example.com:465 Timed Out at /var/www/example.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:166)
I have tried also with tls instead of ssl but the same error.
I have configure that email [email protected] in thunderbird with the given settings from the provider and works.
Email settings:
incoming: IMAP server.example.com 993 SSL/TLS Encrypted password
outgoing: SMTP server.example.com 465 SSL/TLS Encrypted password
username (email address) and password.
I am missing something ????
In my case the error was misleading. It's wasn't a timeout but was caused by the wrong encryption setting.
In my case I needed to set MAIL_ENCRYPTION=ssl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With