Okay, this one now goes in my book of $500 tips. (meaning, it will save you a day or two of debugging, just to know about this problem & solution).
Our server has a section where potential customers can ask for estimates. They enter some contact info and a short description of their service need. When they click “Calculate”, it is supposed to send an email message to the appropriate sales contact for the customer’s sales region. Well, about a month ago, sales reps started complaining that they thought they were getting fewer sales leads via email than they expected. Thus began my quest….
The program had some error logging built into it, which showed occasional errors:
Could not access ‘CDO.Message’ object. at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object args)
COMException (0x80040212): The transport lost its connection to the server.
Initially, we thought, maybe our SMTP server was saturated, so we set up SMTP on the local (web) server to send emails. That seemed to work for sales reps with internal email addresses, however the reps with gmail or aol or hotmail accounts got bounced back. So, we configured the SMTP server to fwd all its content to our “official” SMTP server. Thereby, giving us maximum availability, while remaining kosher with all those anti-spyware engines who get suspicious of email from your domain but not from your mail server.
…of course, that wasn’t the problem. That would have been too easy! It only seemed to work for about 4 consecutive emails. Then, it went back to erroring out like it was before. Darn! In fact, every SMTP server that my web app tried to use, seemed to work for about 4 uses, then, crap!
Well, long story short, it took me about two days to figure out that the problem was caused by Symantic Antivirus installed on the web server. It must have downloaded an automatic update (roughly, a month ago) that was suspicious of any program that sent occasional emails (like my web program was doing). So, it would allow 4 to go through, then it would block the rest.
We were able to confirm this by disabling symantic. Funny thing is, that it managed to re-enable itself after 15 minutes. The sys-admin wound up uninstalling it and installing a newer version, which contained an option to allow certain processes (that you have to choose and configure) to send email.