console application send email error

  • Thread starter Thread starter jam
  • Start date Start date
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
 
Back
Top