Solved

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

Posted on 2004-09-11
6
19,020 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 200 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 200 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 100 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

813 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now