Sending Magento SMTP email problem with Google App mail

We just upgraded from Magento 1.3 to Magento 1.4.2, switched hosting providers, and suddenly our transactional emails were not being sent out. We were using the SMTP Pro extension by Ashley Schroeder (highly recommended, btw).

The problem turned out to be with our hosting provider, Nexcess. They were blocking port 587 in their firewall. The SMTP Pro extension connects to your Google Apps account through port 587.

We figured this out using a very simple script that can be helpful in a variety of ways (this was originally found on Google Groups, I can’t seem to¬†find it again or I would be happy to give attribution):

$fp = fsockopen(“”, 25, &$errno, &$errstr, 10);
if(!$fp) {
echo “ 587 – $errstr ($errno) n”;
} else {
echo “ 587 – ok n”;
Run this php script within your root Magento directory to see if you are able to connect to on port 587. You can easily change the port number to test access to other ports. If you get an error, contact your hosting company to have them remove the block. If you get an “Ok”, time to start digging a little deeper. Good luck! Email problems can be a headache in Magento.

If you are still having issues, contact us and we may be able to help you resolve it.