Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Swift_TransportException: Unable to connect with TLS encryption

I have migrated to new server from old server. There are quite changes in new server. Old server was using PHP 5.6 and phalcon 3.2 and new server is using PHP 7.3 & phalcon 3.4.4.

In old server email sending is working smoothly but in new server it's throwing the below error:

Swift_TransportException: Unable to connect with TLS encryption

Server Mail configuration in both sites are:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls

NOTE: Old site was on http and new site is on https



7.7k

Don't think this is Phalcon related but Swift related. I do had something similair in a different project, it had something to do with the encryption settings.



2.1k
Accepted
answer

After 35 hours research and with the help of our great team finally found the solution :)

SMTP restriction was enabled on our server from WHM. After disabling the SMTP restriction the error was gone.

You can find this in WHM by searching SMTP and it will be available under security center. Disable it and this error will be no more.

smtp restrictions snap