We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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



10.1k

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.



5.8k
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