Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > System.Net.Mail Error: Unable to read data from the transport connection: net_io_connectionclosed

Reply
Thread Tools

System.Net.Mail Error: Unable to read data from the transport connection: net_io_connectionclosed

 
 
nate.strules@gmail.com
Guest
Posts: n/a
 
      07-13-2006
I've looked everywhere for an answer to this, but only a few people
seem to have encountered it.

The code is straightforward:

MailMessage mail = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient("localhost");
client.Send (mail);

The code works fine on my development machine (XP Pro). When moved to
staging (2003 Server), I get the "connection closed" error. I've
confirmed the following:

-- "localhost" resolves to 127.0.0.1 (also tried using the loopback
address with the same error)
-- SMTP service is running on port 25
-- service is configured to relay mail
-- another app (Community Server) is using the service to send email
without any problems.

I'm at wit's end

TIA

 
Reply With Quote
 
 
 
 
nate.strules@gmail.com
Guest
Posts: n/a
 
      07-14-2006
As usual, this problem was resolved out not long after posting this
message. The problem was how the SMTP service was set up.
Specifically, the service has been bound to a specific IP address (not
the webserver's; see the "IP Address" dropdown in the "General" tab).
Once this was set to "(All Unassigned)". Everything worked fine.
Hopefully this message will save someone the hours of aggravation I
endured.

wrote:
> I've looked everywhere for an answer to this, but only a few people
> seem to have encountered it.
>
> The code is straightforward:
>
> MailMessage mail = new MailMessage(from, to, subject, body);
> SmtpClient client = new SmtpClient("localhost");
> client.Send (mail);
>
> The code works fine on my development machine (XP Pro). When moved to
> staging (2003 Server), I get the "connection closed" error. I've
> confirmed the following:
>
> -- "localhost" resolves to 127.0.0.1 (also tried using the loopback
> address with the same error)
> -- SMTP service is running on port 25
> -- service is configured to relay mail
> -- another app (Community Server) is using the service to send email
> without any problems.
>
> I'm at wit's end
>
> TIA


 
Reply With Quote
 
 
 
 
narayanak narayanak is offline
Junior Member
Join Date: Sep 2006
Posts: 1
 
      09-07-2006
Quote:
Originally Posted by
As usual, this problem was resolved out not long after posting this
message. The problem was how the SMTP service was set up.
Specifically, the service has been bound to a specific IP address (not
the webserver's; see the "IP Address" dropdown in the "General" tab).
Once this was set to "(All Unassigned)". Everything worked fine.
Hopefully this message will save someone the hours of aggravation I
endured.

wrote:
> I've looked everywhere for an answer to this, but only a few people
> seem to have encountered it.
>
> The code is straightforward:
>
> MailMessage mail = new MailMessage(from, to, subject, body);
> SmtpClient client = new SmtpClient("localhost");
> client.Send (mail);
>
> The code works fine on my development machine (XP Pro). When moved to
> staging (2003 Server), I get the "connection closed" error. I've
> confirmed the following:
>
> -- "localhost" resolves to 127.0.0.1 (also tried using the loopback
> address with the same error)
> -- SMTP service is running on port 25
> -- service is configured to relay mail
> -- another app (Community Server) is using the service to send email
> without any problems.
>
> I'm at wit's end
>
> TIA
Hi,
As you said I have configured the SMTP and there is no error coming to me but the email is not going to specific address. Instead it is stored as .EML file in "C:\Inetpub\mailroot\Queue" folder.
This is the code
Dim mailServerName As String = "110.119.190.238"
Try
Dim message As New MailMessage(from, too, subject, Body)
message.IsBodyHtml = True
Dim mailClient As New SmtpClient()
mailClient.Host = mailServerName
mailClient.Port = 25
mailClient.UseDefaultCredentials = True
mailClient.DeliveryMethod = SmtpDeliveryMethod.Network
Dim attachmentPath As String = Server.MapPath("Report.pdf")
Dim attach As New Attachment(attachmentPath)
message.Attachments.Add(attach)
mailClient.Send(message)
Catch Ex As SmtpException
Throw New ApplicationException("SmtpException has oCCured: " + Ex.Message)
Catch Ex As Exception
Throw Ex
End Try

Here I am specifying the "DeliveryMethod = SmtpDeliveryMethod.Network" also. Instead of that also it is not sending the mail. If I remove also it is storing .EML file in the above mentioned folder.

Please help me out.
thanks
Narayana
 
Reply With Quote
 
jzhou07 jzhou07 is offline
Junior Member
Join Date: Nov 2006
Posts: 1
 
      11-13-2006
Thanks for the sharing this with us, it does save me a lot of time. But I am wondering why it solves the problem? I am calling the smtp from one of my web service which sits on the machine that specified on the drop down list, why shall I change it to All Unassigned?

Jason


Quote:
Originally Posted by
As usual, this problem was resolved out not long after posting this
message. The problem was how the SMTP service was set up.
Specifically, the service has been bound to a specific IP address (not
the webserver's; see the "IP Address" dropdown in the "General" tab).
Once this was set to "(All Unassigned)". Everything worked fine.
Hopefully this message will save someone the hours of aggravation I
endured.

wrote:
> I've looked everywhere for an answer to this, but only a few people
> seem to have encountered it.
>
> The code is straightforward:
>
> MailMessage mail = new MailMessage(from, to, subject, body);
> SmtpClient client = new SmtpClient("localhost");
> client.Send (mail);
>
> The code works fine on my development machine (XP Pro). When moved to
> staging (2003 Server), I get the "connection closed" error. I've
> confirmed the following:
>
> -- "localhost" resolves to 127.0.0.1 (also tried using the loopback
> address with the same error)
> -- SMTP service is running on port 25
> -- service is configured to relay mail
> -- another app (Community Server) is using the service to send email
> without any problems.
>
> I'm at wit's end
>
> TIA
 
Reply With Quote
 
karlitros karlitros is offline
Junior Member
Join Date: Jul 2007
Posts: 1
 
      07-05-2007
You don't have to set the IP address box to all unassigned, you can simply use the IP address that's specified as it stands. That's what I did, anyway.

And yes, I registered just to answer this question!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to read data from the transport Connection ninjamonkey ASP .Net 4 09-11-2007 02:11 AM
Pocket PC - Unable to read data from the transport connection Jay Balapa ASP .Net 7 07-04-2007 07:39 PM
want to replace a read only cd transport with read / write transport larya Computer Support 7 09-11-2006 10:21 PM
System.IO.IOException: Unable to read data from the transport connection Mentalis ASP .Net 0 07-12-2006 03:43 PM
Unable to read data from the transport connection =?Utf-8?B?S2VpdGggQXZlcnk=?= ASP .Net 2 12-30-2005 07:58 PM



Advertisments