Try using port 465.
If it doesn't fix the issue make sure you read the following: https://support.google.com/mail/answer/78775?hl=en&ref_topic=3397962
Edit: Maybe you don't have SSL enabled in your server. There is a quick test. Create a file zzz.php next to your qa-config.php file and append this content to former:
<?php
$fp = fsockopen("www.google.com", 80, &$errno, &$errstr, 10); // works fine
if(!$fp)
echo "www.google.com - $errstr ($errno)<br>\n";
else
echo "www.google.com - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 465, &$errno, &$errstr, 10); // Does not work
if(!$fp)
echo "smtp.gmail.com 465 - $errstr ($errno)<br>\n";
else
echo "smtp.gmail.com 465 - ok<br>\n";
$fp = fsockopen("smtp.gmail.com", 587, &$errno, &$errstr, 10); // Does not work
if(!$fp)
echo "smtp.gmail.com 587 - $errstr ($errno)<br>\n";
else
echo "smtp.gmail.com 587 - ok<br>\n";
echo "<br />".phpinfo();
www.google.com - ok
smtp.gmail.com 465 - ok
smtp.gmail.com 587 - ok
And a bunch of information about PHP. Use your browser's search and paste ALL relevant SSL information (including the section header). EG, for openssl I have:
OpenSSL support |
enabled |
OpenSSL Library Version |
OpenSSL 0.9.8o 01 Jun 2010 |
OpenSSL Header Version |
OpenSSL 0.9.8o 01 Jun 2010 |
Finally, delete the zzz.php file.
Edit2:
If you can't access
zzz.php file you can go to your
qa-theme.php file and look for function doctype(). Backup (copy/paste) the content of that function. Replace it with the one in this gist:
https://gist.github.com/pupi1985/67aff930780d8848d0b9 . Make sure to replace
'admin' with YOUR username. This will show the output when accessing any page
but only to you. In order to be able to navigate your site again just get the backed up function text and replace it again.
Bear in mind when performing SMTP tests with gmail you should login frequently to the web as sometimes they block the connections and you need to enable them from there.