Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why I'm getting Swift_TransportException: Unable to connect with TLS encryption in Server?

Tags:

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

like image 645
Iftikhar uddin Avatar asked Aug 06 '19 09:08

Iftikhar uddin


1 Answers

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

like image 187
Iftikhar uddin Avatar answered Sep 28 '22 03:09

Iftikhar uddin