A web site dealing with villas is written in classic ASP. When an enquiry for a property is submitted by a customer an e-mail is generated containing all the details of the enquiry.
All has been working well until today when it crashed with a mail error. The error was as follows:
CDO.Message.1 error '8004011b'
From searching about, this seems to look like an error regarding the mail server being unavailable - or can't be connected to.
However, I knew this couldn't be the case because the same server had other sites sending mail OK using similar code.
To narrow down the issue I started stripping out the HTML from the body text of the email that was being sent. Part of the information was the arrival date and time and departure date and time from the property that had been requested. This was where I started to find a difference between it working and not working.
If I removed the departure information it worked OK, if I swapped departure for arrival information and basically replicated the arrival code (for testing purposes), it failed! What became more strange was that taking the colon our of the middle of the departure time caused the email to send, despite the fact the arrival date had it in!. Placing a colon at the end of the time also caused it to work.
So "1000" and "10:00:" both worked but "10:00" didn't. This was turning out to be quite a bizarre problem!
Upon trying random things in the code I solved the issue. There must be a character limit on the commands sent to a mail server, or at least an IIS SMTP server, and the colon was appearing at the end of a line being sent which must have given the server a problem.
The solution was to place new lines (vbNewLine) in the code above so that the HTML wasn't one big string and the mail server didn't have any issues.
I knew that dots could cause issues but colon's was something new for me.
Thanks - I also tried everything you can think of, then read your article and a similar one - it is bizarre hey? My message contained an HTML table and I just added (to all table row ending tags), a "vbCrLf" - then it worked ..
ReplyDelete