console application send email error

J

jam

Dear All,

I am writing a console and it send a email out when it hits error

it calls this
static void SendErrorEmail(string error)
{
System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage();
System.Web.Mail.SmtpMail.SmtpServer = smtpServer;

mail.To = emailaddress;
mail.Subject = "error occur";
mail.From = "(e-mail address removed)";
mail.Body = error;
System.Web.Mail.SmtpMail.Send(mail);
}
it gaves error Could Not Access CDO.Message Object

So what is the problem I am hiting??

jam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top