P
pseudonym
Hi all.
I've got a service that needs to send email if there's a critical failure.
The following code works fine in an otherwise empty service:
Protected Overrides Sub OnStart(ByVal args() As String)
System.Web.Mail.SmtpMail.SmtpServer = "mysmtp.com"
System.Web.Mail.SmtpMail.Send("mysvc", "(e-mail address removed)", "foobar",
"test")
End Sub
However, in the real service, the same two lines of code fail with the error
"Could not access CDO.Message object"
In case it matters, this occurs in an exception handler inside a timer
event.
Can anyone tell me why this might be happening, and how to get around it?
Thanks!
I've got a service that needs to send email if there's a critical failure.
The following code works fine in an otherwise empty service:
Protected Overrides Sub OnStart(ByVal args() As String)
System.Web.Mail.SmtpMail.SmtpServer = "mysmtp.com"
System.Web.Mail.SmtpMail.Send("mysvc", "(e-mail address removed)", "foobar",
"test")
End Sub
However, in the real service, the same two lines of code fail with the error
"Could not access CDO.Message object"
In case it matters, this occurs in an exception handler inside a timer
event.
Can anyone tell me why this might be happening, and how to get around it?
Thanks!