PHP email SMTP via Gmail intermittent timeout failure


#1

I use Google gmail’s SMTP server to send outgoing emails from my Dreamhost website using php. Up until a few months ago it was working perfectly but recently about 20% of these emails fail due to a “smtp_error - 110 Connection timed out” error. The script connects via SSL with authentication over port 465 to smtp.gmail.com.

The shared webhost the site is running on has a light load average and the problem persists even after a restart of Apache. I reported this to Dreamhost techs and they suggest that it is a “Google” problem. I suspect that packets are being dropped somewhere in the network, but it is difficult to troubleshoot due to the intermittent nature of the problem.

Pinging smtp.gmail.com from the server consistently averages around 8.3ms with no dropped packets whatsoever so perhaps there is some weird packet filtering going on somewhere.

Using sendmail via the local Dreamhost SMTP server is not an option due to various anti-spam policies of my google apps hosted domain name.

Any suggestions?


#2

is it possible that you have reached Google’s limit for sending emails? I think it is 100 per message.


#3

No, I dont think so. I only send about 80 individual messages throughout the day, and the 20% fail randomly throughout.