473,396 Members | 1,998 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,396 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 2450
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.