Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Intermittent MailMessage Rrror
Message
From
05/03/2004 10:03:05
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00882426
Message ID:
00883459
Views:
11
Hi Jim ( and Cathy :-) ),

Thanks for the info and for responding. Yes, I am setting the SMTP server name in my code as you indicate in your sample code. Since the issue is so random and intermittent, I am surmising the problem is either connectivity related or, as you mention, the SMTP server is offline, bogged down, taking a coffee break, etc.

To combat this I have implemented some code to try the send, capture any error, wait a specified amount of time and retry the send a specified number of retries. Main issue for me here is this is an ASP.NET OLTP scenario so I can't make the user wait too long to notify them of the success/fail of the situation. I currently have total max wait time of about 15 seconds with 5 retries.

I will run this awhile and see what kind of results I get. It's a quirky situation where I am having to submit data into a third party DB via e-mail. I would prefer to use their API to go direct eliminating the extra layer but I'm currently stuck with these constraints.

Bill

>Bill,
>
>I don't know if this will resolve your issue or not, but I ran into an issue where after upgrading certain applications on some Windows 2000 servers, all of my messages generated that error. After looking into it, it appears that newer versions of CDO require that you specify the smtp server before sending the message. I'd been accustomed to using CDONTS with ASP classic and never had to specify a server. Since my intial messaging implementation worked for some time without any issues, I'd never anticipated this issue until somebody installed a new version of MS Project on a server I had deployed an application on, and it installed a new version of CDO.
>
>The short of it is, specifying the smtp server (if you don't already) could be the ticket to resolving your issue. With any ASP.NET site I develop that has to send mail, I add an item to the Web.Config for a site smtp server in the AppSettings section like this.
>
>
><appSettings>
>       <add key="SiteSmtpServer" value="localhost"></add>
></appSettings>
>
>
>In this example, I specify localhost (it's an app I'm working on developing on my local box at the moment) but that could be any valid smtp server's hostname or ip address. Then in my code I would write
>
>
>Dim objSmtp As System.Web.Mail.SmtpMail
>objSmtp.SmtpServer = ConfigurationSettings.AppSettings("SiteSmtpServer")
>
>
>I can then generate a System.Web.Mail.MailMessage and send it with the SmtpMail object I've already created.
>
>
>Dim objMail As New System.Web.Mail.MailMessage
>objMail.Subject = "Here is the subject"
>objMail.Body = "Here is the body of the message"
>objMail.To = "youremail@yourdomain.com"
>objMail.From = "jerwin@visionds.com"
>
>objSmtp.Send(objMail)
>
>
>If in fact it turns out that you're already specifying an smtp server, or this doesn't resolve your issue, it could be that whatever smtp server you are using is having issues that when you call the send method, the server is offline, overloaded or otherwise unavailable to send it. Working around this would require adding some kind of queueing for your messages where you have another service running that will queue your messages and keep trying to send them until the server is available and they are sent. I believe you can find something that does this from quiksoft (www.quiksoft.com) called EasyMail SMTP Express.
>
>
>Hope this helps.
>
>regards,
>
>JE
>
>
>>I have an ASP.NET application in which part of the business process is to instantiate a MailMessage object and send a mail message via an SMTP server. This all works properly for the most part.
>>
>>However, once in a while, intermittently, my error log indicates I get the error:
>>Could not access 'CDO.Message' object
>>Since this happens only once in a while, I suspect that it is either network connectivity related or possibly the SMTP Server itslef is not responding for some reason.
>>
>>Has anyone seen this kind of behavior and knows the various causes/cures if any?
>>
>>Thanks,
>>Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Reply
Map
View

Click here to load this message in the networking platform