PHPMailer to use Gmail as SMTP server.Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host

Solution 1:

in you php.ini make sure you have uncommented the line with

extension=php_openssl.dll