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

Could not access 'CDO.Message' object.

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.