Solved

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

Posted on 2004-09-11
6
19,095 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

830 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