[SOLVED] PHPMailer: SMTP Error: Could not connect to SMTP host – SSL support issue in PHP

Last Updated On August 02, 2019

There are many popular cases for the failure of SMTP connection in PHPMailer and lack of SSL is one of that too.

There might be a case, that the Open SSL extension is not enabled in your php.ini which is creating the connection problem.

So, once you enable the extension=php_openssl.dll in the ini file.

Enable debug output, so that you can really see that SSL is the actual problem or not. PHPMailer gives a functionality by which you can get detailed logs of the SMTP connection.

You can enable this functionality by including the following code in your script;

$mail->SMTPDebug = 2;

By setting the value of SMTPDebug property to 2, you will be actually getting both server and client level transcripts.

For more details on the other parameter values, please refer the official PHPMailer Wiki.

In case you are using Godaddy hosting, then just enabling SSL might not fix your problem. Because there are other serious challenges with Godaddy which you can read here.

Recent Posts

Leave a Comment

We are always looking for fresh talent to contribute to our blog. If you have a knack for writing and a passion for email marketing, we would love to have your post on our Guest Blog .

Submit a Guest Post
Pepi thinking

Start typing and press Enter to search

Thank you for your details!

Fill out your information below, and we will send you a PepiAlert, that will describe your domain’s email deliverability situation. Please note that your email address must match the domain, or the domain must be owned by the company matching the email address. We have the right to refuse the request, if we can’t verify the information.

*All fields are required

Pin It on Pinterest