Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

System.Net.Mail - Unable to read data from the transport connection

Posted on 2006-07-05
2
Medium Priority
?
1,093 Views
Last Modified: 2007-12-19
Hello

I'm migrating an app to ASP.NET 2.0 and I can't get any email out.  I've tried a few different samples of sending email via System.Net.Mail, and tried setting the Web.Config to -

 <system.net>
  <mailSettings>
   <smtp from="">
    <network host="192.168.250.104" password="" userName="" />
   </smtp>
  </mailSettings>
 </system.net>

but I always get the same error -

Unable to read data from the transport connection: net_io_connectionclosed.
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.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.

Source Error:

Line 116:        
Line 117:        client.Send(message);
Line 118:    }
Line 119:  
 


The code is

    public static void SimpleMailTest()
    {
        System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
        message.From = new MailAddress("jakobnixon@jnixon.com");
        message.To.Add(new MailAddress("jakobnixon@jnixon.com"));
        message.Subject = "This is my subject";
        message.Body = "This is the content";

        System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("192.168.250.104", 25);
       
        client.Send(message);
    }


The IIS SMTP service always worked fine with CDONTS and System.Web.Mail. Any help much appreciated.

JN
0
Comment
Question by:jakobnixon
[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
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 300 total points
ID: 17044324
1) If it works fine with System.Web.Mail, then why do you need to change to System.Net.Mail?

2) Are you going through a firewall/proxy?

Bob
0
 

Author Comment

by:jakobnixon
ID: 17048985

I hadn't realised that Web.Mail was still available in 2.0 - I thought it was left with 1.1.

I've just set it up with Web.Mail and it's fine.  I've no need to use the features of Net.Mail yet, so until that day comes, the transport connetction issue isn't a problem.

Many thanks for your help -

JN
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

715 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