473,385 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Could not access 'CDO.Message' object.

I "occastionally" receive this error message when sending e-mail through the
code below. It doesn't happen every time, but perhaps 10-30% of the time, I
receive this exception message.

SendCorrespondence: exception: Could not access 'CDO.Message' object.

Any suggestions greatly appreciated!

Thanks

Here's the source code:

private static bool SendCorrespondence(System.Web.UI.Page Page)
{
bool bReturn = true;

try
{
MailMessage mail = new MailMessage();
mail.BodyFormat = MailFormat.Text;
mail.To = <to>;
mail.Bcc = <bcc>;
mail.From = <from>;
mail.Subject = <subject>;
mail.Body = <body>;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"webapp@<site>.com"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"<pw>"); //set your password here
SmtpMail.SmtpServer = "<mail server>"; //your real server goes
here
SmtpMail.Send(mail);
}
catch (Exception objException)
{
bReturn = false;
WriteLog ("SendCorrespondence: exception: " +
objException.Message);
}
finally
{
}

return bReturn;
}

Nov 19 '05 #1
2 2448
I added a check of the InnerException, with this code:

if (objException.InnerException != null)
{
WriteLog ("SendCorrespondence: InnerException: exception: " +
objException.InnerException.ToString());
}

Here's what I got, but I sure don't know what it means.

SendCorrespondence: InnerException: exception:
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80040211): The message could
not be sent to the SMTP server. The transport error code was 0x80040217. The
server response was not available

"Thomas I." <no**********@yahoo.com> wrote in message
news:MM***************@tornado.rdc-kc.rr.com...
I "occastionally" receive this error message when sending e-mail through
the code below. It doesn't happen every time, but perhaps 10-30% of the
time, I receive this exception message.

SendCorrespondence: exception: Could not access 'CDO.Message' object.

Any suggestions greatly appreciated!

Thanks

Here's the source code:

private static bool SendCorrespondence(System.Web.UI.Page Page)
{
bool bReturn = true;

try
{
MailMessage mail = new MailMessage();
mail.BodyFormat = MailFormat.Text;
mail.To = <to>;
mail.Bcc = <bcc>;
mail.From = <from>;
mail.Subject = <subject>;
mail.Body = <body>;

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1"); //basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"webapp@<site>.com"); //set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"<pw>"); //set your password here
SmtpMail.SmtpServer = "<mail server>"; //your real server goes
here
SmtpMail.Send(mail);
}
catch (Exception objException)
{
bReturn = false;
WriteLog ("SendCorrespondence: exception: " +
objException.Message);
}
finally
{
}

return bReturn;
}

Nov 19 '05 #2
This exception gets thrown anytime there is a problem communicating with the
SMTP server.

"Thomas I." <no**********@yahoo.com> wrote in message
news:Nt****************@tornado.rdc-kc.rr.com...
I added a check of the InnerException, with this code:

if (objException.InnerException != null)
{
WriteLog ("SendCorrespondence: InnerException: exception: " +
objException.InnerException.ToString());
}

Here's what I got, but I sure don't know what it means.

SendCorrespondence: InnerException: exception:
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80040211): The message
could not be sent to the SMTP server. The transport error code was
0x80040217. The server response was not available

"Thomas I." <no**********@yahoo.com> wrote in message
news:MM***************@tornado.rdc-kc.rr.com...
I "occastionally" receive this error message when sending e-mail through
the code below. It doesn't happen every time, but perhaps 10-30% of the
time, I receive this exception message.

SendCorrespondence: exception: Could not access 'CDO.Message' object.

Any suggestions greatly appreciated!

Thanks

Here's the source code:

private static bool SendCorrespondence(System.Web.UI.Page Page)
{
bool bReturn = true;

try
{
MailMessage mail = new MailMessage();
mail.BodyFormat = MailFormat.Text;
mail.To = <to>;
mail.Bcc = <bcc>;
mail.From = <from>;
mail.Subject = <subject>;
mail.Body = <body>;

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1"); //basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"webapp@<site>.com"); //set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"<pw>"); //set your password here
SmtpMail.SmtpServer = "<mail server>"; //your real server goes
here
SmtpMail.Send(mail);
}
catch (Exception objException)
{
bReturn = false;
WriteLog ("SendCorrespondence: exception: " +
objException.Message);
}
finally
{
}

return bReturn;
}


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Thys Brits | last post by:
Hi, I'm using the System.Web.Mail class to send an e-mail from my ASP.Net application, but when sending the e-mail, I'm getting the above error. It seems to be because I have Office XP...
2
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail...
2
by: Desmond | last post by:
Hi, I would really appreciate if somebody could give some advise on this. I've a ASP.NET application that is supposed to send emails and it is tested to be working well on IIS 5.0 and tested...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
1
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line...
4
by: Liz Patton | last post by:
Here's the exception: System.Exception: Unable to send mail: Could not access 'CDO.Message' object. ---> System.Web.HttpException: Could not access 'CDO.Message' object. --->...
2
by: MattB | last post by:
I've taken some working code from a vb clas library that was a part of a web application and put it into a stand alone class library so I can reuse it from other applications. I'm using some code...
3
by: pmud | last post by:
Hi, I have ab ASP.Net Application in which I need to send e-mail on button click. Even though my C# code for that is correct.I am getting the following error:: I think the following error can be...
3
by: Anthony Fine | last post by:
Hello All, I have a VB.Net app that needs to send mail. I have created a class for building my e-mail, but keep getting the error (Could not access 'CDO.Message' object.) when trying to send...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.