The message could not be sent to the SMTP server. The transport error code was 0x80040217. The serve

J

Janna Deegan

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:
"
The message could not be sent to the SMTP server. The transport error code
was 0x80040217. The server response was not available

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The message
could not be sent to the SMTP server. The transport error code was
0x80040217. The server response was not available

Source Error:


An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:


[COMException (0x80040211): The message could not be sent to the SMTP
server. The transport error code was 0x80040217. The server response was not
available
]

[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1840
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
Intranet.srcMail.sendMailNow(String listID) in c:\documents and
settings\sean\vswebcache\srcfileserver\intranet\srcmail.cs:128
Intranet.srcCommon.fnSendMail(String strTo, String strSubject, String
strBody, String list_ID, String groupID, String Mailing) in c:\documents and
settings\sean\vswebcache\srcfileserver\intranet\srccommon.cs:257
Intranet.srcCommon.doMail(Boolean bTest, String strEmailAddress, String
txtBody, String txtSubject, String listID, String groupID, String Mailer) in
c:\documents and
settings\sean\vswebcache\srcfileserver\intranet\srccommon.cs:100
Intranet.TestMailToSignups.Button1_Click(Object sender, EventArgs e) in
c:\documents and
settings\sean\vswebcache\srcfileserver\intranet\testmailtosignups.aspx.cs:12
3
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277





----------------------------------------------------------------------------
----

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573 "

My question is this: What would cause this behaviour? I have since changed
several lines of code to try to fix the problem, but have not had any
success. This has happened to me in the past and it seemed like rebooting
the server may have fixed it, not this time however.

Here's my code snippit:

public void sendMailNow(string listID)

{

MailMessage myMail = new MailMessage(); myMail.To = ToMail;

if(mBCC != "")

myMail.Bcc = mBCC;

myMail.From = FromMail;

myMail.Subject = mSubject;

myMail.BodyFormat = mFormat;

myMail.Body = mBody;

myMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthentica
te"] = 1;

myMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"]
= mUserName;

myMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"]
= mPassword;

SmtpMail.SmtpServer = mSMTPServer;

SmtpMail.Send(myMail);

logMailnow(ToMail,listID);

}
 
J

Janna Deegan

Sorry, I hit send prior to finishiing up the message:

All variables listed in my code at the bottom are set through properties...

It just seems strange to me that it works then stops. I'm using this for
emails to people who have signed up for newsletters (and there's only a
handful). Basically, I'm trying to let the other folks in my office manage
their own communciations with our clients through a web interface.

Thanks in advance for your help.

Janna Deegan said:
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:
"
The message could not be sent to the SMTP server. The transport error code
was 0x80040217. The server response was not available

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The message
could not be sent to the SMTP server. The transport error code was
0x80040217. The server response was not available

Source Error:


An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:


[COMException (0x80040211): The message could not be sent to the SMTP
server. The transport error code was 0x80040217. The server response was not
available
]

[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1840
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
Intranet.srcMail.sendMailNow(String listID) in c:\documents and
settings\sean\vswebcache\srcfileserver\intranet\srcmail.cs:128
Intranet.srcCommon.fnSendMail(String strTo, String strSubject, String
strBody, String list_ID, String groupID, String Mailing) in c:\documents and
settings\sean\vswebcache\srcfileserver\intranet\srccommon.cs:257
Intranet.srcCommon.doMail(Boolean bTest, String strEmailAddress, String
txtBody, String txtSubject, String listID, String groupID, String Mailer) in
c:\documents and
settings\sean\vswebcache\srcfileserver\intranet\srccommon.cs:100
Intranet.TestMailToSignups.Button1_Click(Object sender, EventArgs e) in
c:\documents and
settings\sean\vswebcache\srcfileserver\intranet\testmailtosignups.aspx.cs:12
3
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277





-------------------------------------------------------------------------- --
----

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573 "

My question is this: What would cause this behaviour? I have since changed
several lines of code to try to fix the problem, but have not had any
success. This has happened to me in the past and it seemed like rebooting
the server may have fixed it, not this time however.

Here's my code snippit:

public void sendMailNow(string listID)

{

MailMessage myMail = new MailMessage(); myMail.To = ToMail;

if(mBCC != "")

myMail.Bcc = mBCC;

myMail.From = FromMail;

myMail.Subject = mSubject;

myMail.BodyFormat = mFormat;

myMail.Body = mBody;

myMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthentica
te"] = 1;

myMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"]
= mUserName;

myMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"]
= mPassword;

SmtpMail.SmtpServer = mSMTPServer;

SmtpMail.Send(myMail);

logMailnow(ToMail,listID);

}
 
Joined
May 11, 2005
Messages
2
Reaction score
0
replies probably a bit late :) - but for those other visitors to the site with this error:

It's caused by a wrong username or password for the SMTP server and usually means that the server has disabled your account for spamming if you've sent 1500 mails!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top