I "occastiona lly" 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.
SendCorresponde nce: exception: Could not access 'CDO.Message' object.
Any suggestions greatly appreciated!
Thanks
Here's the source code:
private static bool SendCorresponde nce(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.microso ft.com/cdo/configuration/smtpauthenticat e",
"1"); //basic authentication
mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendusername",
"webapp@<site>. com"); //set your username here
mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendpassword",
"<pw>"); //set your password here
SmtpMail.SmtpSe rver = "<mail server>"; //your real server goes
here
SmtpMail.Send(m ail);
}
catch (Exception objException)
{
bReturn = false;
WriteLog ("SendCorrespon dence: exception: " +
objException.Me ssage);
}
finally
{
}
return bReturn;
} 2 2465
I added a check of the InnerException, with this code:
if (objException.I nnerException != null)
{
WriteLog ("SendCorrespon dence: InnerException: exception: " +
objException.In nerException.To String());
}
Here's what I got, but I sure don't know what it means.
SendCorresponde nce: InnerException: exception:
System.Reflecti on.TargetInvoca tionException: 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**********@y ahoo.com> wrote in message
news:MM******** *******@tornado .rdc-kc.rr.com... I "occastiona lly" 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.
SendCorresponde nce: exception: Could not access 'CDO.Message' object.
Any suggestions greatly appreciated!
Thanks
Here's the source code:
private static bool SendCorresponde nce(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.microso ft.com/cdo/configuration/smtpauthenticat e", "1"); //basic authentication
mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendusername", "webapp@<site>. com"); //set your username here
mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendpassword", "<pw>"); //set your password here SmtpMail.SmtpSe rver = "<mail server>"; //your real server goes here SmtpMail.Send(m ail); } catch (Exception objException) { bReturn = false; WriteLog ("SendCorrespon dence: exception: " + objException.Me ssage); } finally { }
return bReturn; }
This exception gets thrown anytime there is a problem communicating with the
SMTP server.
"Thomas I." <no**********@y ahoo.com> wrote in message
news:Nt******** ********@tornad o.rdc-kc.rr.com... I added a check of the InnerException, with this code:
if (objException.I nnerException != null) { WriteLog ("SendCorrespon dence: InnerException: exception: " + objException.In nerException.To String()); }
Here's what I got, but I sure don't know what it means.
SendCorresponde nce: InnerException: exception: System.Reflecti on.TargetInvoca tionException: 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**********@y ahoo.com> wrote in message news:MM******** *******@tornado .rdc-kc.rr.com...I "occastiona lly" 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.
SendCorresponde nce: exception: Could not access 'CDO.Message' object.
Any suggestions greatly appreciated!
Thanks
Here's the source code:
private static bool SendCorresponde nce(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.microso ft.com/cdo/configuration/smtpauthenticat e", "1"); //basic authentication
mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendusername", "webapp@<site>. com"); //set your username here
mail.Fields.Add ("http://schemas.microso ft.com/cdo/configuration/sendpassword", "<pw>"); //set your password here SmtpMail.SmtpSe rver = "<mail server>"; //your real server goes here SmtpMail.Send(m ail); } catch (Exception objException) { bReturn = false; WriteLog ("SendCorrespon dence: exception: " + objException.Me ssage); } finally { }
return bReturn; }
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 installed, and the version of CDO is
replaced by this installation. I haven't been able to find this error
anywhere on any MS site. Anyone have a clue on how to then actually send the
e-mail?
Thanks
|
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 objects.
I was able to run my application fine for roughly 1500 email messages. The
next time I tried sending mail, it stopped working with the message:
"
|
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 working in .NET Framework 1.0/1.1.
Recently this is ported over to IIS 6.0 using .NET
Framework 1.1 and the error "Could Not Access CDO.Message
object" is encountered.
I suspect it could be due to the low privilege asp.net
|
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect.
I think it is a relay issue. Our system administrator will not allow relaying.
In the ASP.Net web.config file I let the web application...
|
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect.
I think it is a relay issue. Our system administrator will not allow relaying.
In the ASP.Net web.config file I let the web application...
| |
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 below. Once I set the BodyFormat to MailFormat.Html then I get:
HttpException (0x80004005): Could not access 'CDO.Message' object
Otherwise, everything works fine and I get my html tags in plain text. I've got it working (in plain text) with my...
|
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. ---> System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error
--- End of inner exception stack trace ---
|
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 (pasted below) to send email
that uses the mail.mailmessage object. It compiles ok, and debugs ok until
the mail is supposed to be sent and it throws an exception, whitht e
message: "Could not access 'CDO.Message' object.".
Can anyone suggest...
|
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 bcoz of the SMTP virtual server. I
cant view the SMTP virtual server in IIS. How to correct this error???
Send failure: System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException:...
|
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 it. I can successfully send an
e-mail when I use the CreateObject("CDO.Message") method, but it fails when
trying to send using VB.Net. My code is below, I have included three
different ways that I have tried it, and both VB.Net options fail, any...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |