By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,238 Members | 1,804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,238 IT Pros & Developers. It's quick & easy.

console application send email error

P: n/a
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 = "ab*@123.com.hk";
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

Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
do you have the permissions to send mail to the SMTP server?

HTH

Ollie Riches

"jam" <hk***@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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 = "ab*@123.com.hk";
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

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.