Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Intermittent MailMessage Rrror
Message
 
To
02/03/2004 14:41:03
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00882426
Message ID:
00883319
Views:
6
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform