Solved

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

Posted on 2004-09-11
6
19,157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syntax for query to update table 2 53
Tracking uptime for a bunch of sites 3 113
Programming Language for Wordpress 7 82
certificate error on website only in internal network 24 101
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

740 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