Click to See Complete Forum and Search --> : SMTP Mailing Help


johnsoga
May 28th, 2003, 10:54 AM
I am trying to use this code to send a test message.

Dim mailmessage As New System.Web.Mail.MailMessage()
Dim mailman As SmtpMail
mailmessage.To = "paul.schroeder@storaenso.com"
mailmessage.Cc = "gabriel.johnson@storaenso.com"
mailmessage.From = "Your Mother"
mailmessage.Subject = "It works"
mailmessage.Body = "You can even put in body text"
mailman.SmtpServer = "smtpServer.com"
mailman.Send(mailmessage)

but sometimes I get the error:

An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll

Additional information: Could not access 'CDO.Message' object.

I have had the exact same code working once or twice but all of the sudden I keep getting the error and then it won't ever work again. What am I doing wrong?