Search code examples
phpmailer

How to force TLS 1.2 usage for PhpMailer 5.2


Recently the 3rd party email service provider I was using made a change. They disabled support for TLS 1.0 and TLS 1.1.

I provide support for an ancient system that still uses php 5.3 and phpmailer 5.2.

My tests indicates that TLS 1.2 is enabled.

But, the PHPMailer code cannot connect to the email server after the disabling of TLS 1.0 and 1.1

Also, note that I am not a full time php expert.

Is there a way to make PHPMailer 5.2 use tls 1.2?


Solution

  • It's not up to PHPMailer, its up to the version of PHP that you're using to run it, so the solution is to update your PHP version. The major changes relating to TLS were largely in PHP 5.6, so upgrading to that would be a good intermediate point if you're really stuck with this legacy version.