Solved

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

Posted on 2004-09-11
6
18,939 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

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

Edward
0
 
LVL 10

Expert Comment

by:avidya
Comment Utility
Hi edward,

Maybe posting your code would help?
0
 
LVL 25

Expert Comment

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

-Nauman.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Search console 3 58
DNS, website, godaddy 6 39
pic in header needs to resize on mobile 4 52
Email address on web page 4 34
Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

728 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

10 Experts available now in Live!

Get 1:1 Help Now