"SMTP Error: Could not connect to SMTP host." problem solution for PHPMailer and GMail
Familiar with this problem?
Yesterday one of my clients asked me to help him with sending emails in PHP.
In the internet there are many places where you can find step by step guides about how to do it, but in the most of them there are no mentions about OpenSSL. OpenSSL must be installed and OpenSSL extension must be enabled in php.ini for using PHPMailer with GMail via SSL.
That was the problem in my case.
The easiest way to check it is to invoke phpinfo(); and to make sure that "OpenSSL support" parameter with value "enabled" is presented. If the parameter is not exist try to uncomment string "extension=php_openssl.dll" in your php.ini. After that if you get an error while starting your web-server you should install OpenSSL.
P.S. PHP is not my main competency, but I hope this post will help you not to spend hours looking for a solution of the problem.

0 comments:
Post a Comment