Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

COMException (0x80040213): The transport failed to connect to the server.

Posted on 2004-09-11
6
Medium Priority
?
19,372 Views
Last Modified: 2011-08-18
Hi experts,

Please help ...

My environment: Windows 2003, IIS wiuth ASP.Net and C#, set up authentication with SMTP server

I use ASP.Net with C# and call CDO.dll to send mail via SMTP server, and this error shows out.

The transport failed to connect to the server.
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 transport failed to connect to the server.

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 (0x80040213): The transport failed to connect to the server.]
   SendMail(String strFrom, String strTo, String strSubject, String content)

 
Would someone give me some ideas to solve this error.
1. I am sure that the user name in strFrom is valid to this SMTP server.
2. let me know what other info you would like to know.

Thanks in advance.

Edward
0
Comment
Question by:edshih
6 Comments
 
LVL 1

Accepted Solution

by:
sharizod earned 600 total points
ID: 12036923
Hi Ed,

A couple of things:

- Make sure that the user you are logged in as has permission to mail out.  You can also
try to manually mail out via smtp using telnet and see if you are able to get that far.
- Re-Verify all mail settings and make sure that you are using SMTP authentication if your server
setup requires it.
- If you are referencing localhost in your code to connect to your mail server, try connecting
instead as 127.0.0.1, perhaps there may be some funky DNS issue or bug there?

Bob
0
 
LVL 10

Assisted Solution

by:avidya
avidya earned 600 total points
ID: 12037541
Hi edward,

The error means that your Smtp server not reacheble:
http://www.experts-exchange.com/Web/Web_Servers/IIS/Q_21024043.html

But ther could be also something wrong with your code, connecting the wrong way, etc .
Here 's a working example, so you can test what is wrong;
http://www.codeproject.com/asp/cdoex.asp
0
 
LVL 25

Assisted Solution

by:nauman_ahmed
nauman_ahmed earned 300 total points
ID: 12037715
Are you setting SmtpMail.Server property as in the following example:

string from = "from@microsoft.com";
string to = "to@microsoft.com";
string subject = "UtilMailMessage001";
string body = "<html><body>UtilMailMessage001 - success</body></html>";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(from, to, subject, body);

-Nauman.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:edshih
ID: 12039174
Thanks for all the hints.
I am still trying to make it work.

Edward
0
 
LVL 10

Expert Comment

by:avidya
ID: 12040148
Hi edward,

Maybe posting your code would help?
0
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 12043925
Do you have SMTP server installed on your server? Check it by going to Internet Information Services management console.

-Nauman.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question