Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, October 3, 2005 1:27 PM
I added arecovery password to the default page, when i try to recover the password i get this error message
Server Error in '/WebSite1' Application.
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:
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:
|
Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44
any clues ?<!-- [IOException]: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyStreamFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyStreamFactory.ReadLines(SmtpReplyStream caller, Boolean oneLine) at System.Net.Mail.SmtpReplyStreamFactory.ReadLine(SmtpReplyStream caller) at System.Net.Mail.SmtpReplyStream.ReadLine() at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) [SmtpException]: Failure sending mail. at System.Net.Mail.SmtpClient.Send(MailMessage message) at System.Web.UI.Util.SendMail(MailMessage message) at System.Web.UI.WebControls.PasswordRecovery.SendMail(String to, String userName, String password) at System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordQuestionView() at System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword() at System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) [HttpUnhandledException]: Exception of type 'System.Web.HttpUnhandledException' was thrown. at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->
All replies (21)
Friday, November 11, 2005 3:42 AM
I'm having this problem too .. did you find a solution?
Thanks!
mike123
Wednesday, February 15, 2006 7:40 AM
What this error means is that System.net.mail was unable to find the smtp server.
The answer will vary depending on whether you have a fixed IP or a dynamic IP but,
basically, you need to assign a valid IP to your smtp server.
With fixed IP's this is relatively straightforward.
With dynamic IP's it takes a bit of tweaking.
Open the IIS Manager and check the properties for the smtp server.
In the Default SMTP Virtual Server's properties, in the "Access" tab,
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )
You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )
Then, in your code, assign your machine name to the smtp client :
Dim client As New SmtpClient("yourmachinename")
client.Send(mail)
Friday, June 22, 2007 9:53 AM
I haven't found a solution yet.
when i find it,i'll let you know.
Ray
Friday, June 22, 2007 11:04 AM
Hi,it's me again,i did what you told me and i overcame the former message,
*In my code i assigned my machine name as *administrator/Computos8,you know the username and machine name.
* and now i get the following message.*
The remote name could not be resolved: 'administrator/Computos8.
Thank you.
Ray
Friday, June 22, 2007 1:14 PM
Unable to read data from the transport connection: net_io_connectionclosed
What this error means is that System.net.mail was unable to find the smtp server.
The answer will vary depending on whether you have a fixed IP or a dynamic IP but,
basically, you need to assign a valid IP to your smtp server.
With fixed IP's this is relatively straightforward.
With dynamic IP's it takes a bit of tweaking.
Open the IIS Manager and check the properties for the smtp server.
In the Default SMTP Virtual Server's properties, in the "Access" tab,
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )
You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )
Then, in your code, assign your machine name to the smtp client :
Dim client As New SmtpClient("yourmachinename")
client.Send(mail)
Saturday, August 18, 2007 1:51 AM
The error usually happens when the smtp server does not recognize the email address in the "from" field. Make sure you set the "from" with an email address that actualy exists in your smtp server.
See code below for an example, note how the email server used in the email of the "from" field is the same as the one specified as the smtp server:
Dim from As String = "[email protected]"
Dim recipientEmail As String = "[email protected]"
Dim m As New MailMessage(from, recipientEmail)
m.Subject = subject
m.Body = message & sb.ToString
Dim client As New SmtpClient("youremailserver.com")
client.Send(m)
Wednesday, August 29, 2007 7:58 AM
hi i am also facing the same problem
i am using the password recovery control in my aspx page
My Web.config
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<add name="defaultConnectionString" connectionString="Data Source=vitws-10;Initial Catalog=jobstarter;User ID=sa;Connect Timeout=200" />
<add name="defaultConnectionString1" connectionString="Data Source=vitws-10;DataBase=jobstarter; User ID=sa;Password=;" />
</connectionStrings>
<system.web>
<pages theme="Default">
</pages>
<compilation debug="true">
<assemblies>
<add assembly="System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Security, Version=2.0.1.2, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
</compilation>
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="~/default.aspx"></forms>
</authentication>
<membership defaultProvider="MyProvider">
<providers>
<add connectionStringName="defaultConnectionString" applicationName="/JobSiteStarterKit"
description="" requiresUniqueEmail="true" enablePasswordRetrieval="false" minRequiredPasswordLength="4"
minRequiredNonalphanumericCharacters="0"
enablePasswordReset="true" requiresQuestionAndAnswer="true" passwordFormat="Hashed"
name="MyProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
</system.web>
<system.net>
<mailSettings>
<smtp from="[email protected]">
<network defaultCredentials="true" host="localhost" password="" userName=""/>
</smtp>
</mailSettings>
</system.net>
<appSettings>
<add key="DBConn" value="Data Source=vitws-10;Database=jobstarter; User ID=sa;password=;"/>
<add key="ProductAmount" value="4.99"/>
<add key="numberToShow" value="20" />
</appSettings>
</configuration>
VITWS-10 is my server.. please help me..
Tuesday, November 20, 2007 8:14 AM
This is an SMTP Virtual server issue, load up IIS and
- Right click Default SMTP Virtual server.
- Change IP address to All Unassigned
This should work..
Sunday, February 17, 2008 7:50 PM
I am also getting this problem but randomnly and I cannot figure out what is going on. The IP address of the mail server is fixed. The machine running the web application does not have SMTP installed. The email addresses are valid and the email server is setup to allow the relay to take place. Any other possibilities I am not looking at?
Friday, April 25, 2008 12:04 PM
i also have the same problem. after i tried all the suggestions, i now get this error message:
The remote name could not be resolved:
Sunday, August 24, 2008 12:35 AM
Thanks man this helped me out a lot!
Erik
Monday, September 15, 2008 6:06 AM
You have specified wrong
smtpClient.Host
or u havenot supplied smtpClient.Host
Mark as Answer if it helps u.
Monday, September 15, 2008 3:37 PM
Thanks a lot.
Assigning a static IP solved the problem
Unable to read data from the transport connection: net_io_connectionclosed
What this error means is that System.net.mail was unable to find the smtp server.
The answer will vary depending on whether you have a fixed IP or a dynamic IP but,
basically, you need to assign a valid IP to your smtp server.
With fixed IP's this is relatively straightforward.
With dynamic IP's it takes a bit of tweaking.
Open the IIS Manager and check the properties for the smtp server.
In the Default SMTP Virtual Server's properties, in the "Access" tab,
in the Connection Control and Relay dialogs, make sure that your local IP is assigned.
( In my case, it's 10.0.0.2... )
You may also need to modify your hosts file, to point 127.0.0.1 to your machine name.
( \WINDOWS\system32\drivers\etc\hosts )
Then, in your code, assign your machine name to the smtp client :
Dim client As New SmtpClient("yourmachinename")
client.Send(mail)
Saturday, January 17, 2009 9:51 AM
Tried all the solutions above, and they don't fix this. The problem is that the connection to the mailserver isn't closed properly. It times out at the mailserver, then the .net connection (with or without pooling) on the webserver times out from being idle too long. We've had all sorts of random errors, all relating down to the same re-use problem of the smtpClient pooling. The actual problem is that there is no proper way to close the connection once you're done.
Set SmtpClient.ServicePoint.MaxIdleTime = 1; according to supported work-around: http://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=146711 which makes all smtp work properly.
Here's a complete sample: Njoy / Peter
MailMessage msgMail = new MailMessage();
msgMail.To.Add(new MailAddress("[email protected]"));
msgMail.Subject = "Message from web";
msgMail.IsBodyHtml = true;
msgMail.Body = "Test message";
SmtpClient Client = new SmtpClient(); /* uses settings form web.config */
Client.ServicePoint.MaxIdleTime = 1; /* without this the connection is idle too long and not terminated, times out at the server and gives sequencing errors */
Client.Send(msgMail);
msgMail.Dispose();
Wednesday, March 4, 2009 2:57 PM
The other thing that can cause this problem... if mail server and the server hosting your code are two different boxes, it can also be a permissions issue. The mail server must allow SMTP connections from the server hosting your code. Grant the server hosting your code permissions to initiate an SMTP connection with the mail server and that can solve this problem.
Friday, May 29, 2009 1:00 PM
The other thing that can cause this problem... if mail server and the server hosting your code are two different boxes, it can also be a permissions issue. The mail server must allow SMTP connections from the server hosting your code. Grant the server hosting your code permissions to initiate an SMTP connection with the mail server and that can solve this problem.
This is very true. I ran into a similar issue. If you are running your exchange server with Virtualization, you need to configure the SmtpClient to the host IP of the Virtual Server, not the physical hosting server name or IP.
Hope this helps someone, took me the better part of two hours of frustration to realize what I was doing wrong.
Peace,
Todd M Stimmell
Principal Software Engineer, CACI Inc.
Wednesday, July 1, 2009 10:10 PM
Right click on Default SMTP virtual server, select Properties, then go to Access tab, click Relay then add the IP address of the computer that send SMTP request to the SMTP server.
Hope ths helps
Tuesday, July 21, 2009 12:25 PM
""""""""""""""""The other thing that can cause this problem... if mail server and the server hosting your code are two different boxes, it can also be a permissions issue. The mail server must allow SMTP connections from the server hosting your code. Grant the server hosting your code permissions to initiate an SMTP connection with the mail server and that can solve this problem.""""""""""""""""""""""
OK
How do you do this?
Tuesday, April 6, 2010 4:26 PM
I am having this problem also. But I do not understand what is needed to resolve the problem. So, here is my code:
SmtpClient client = new SmtpClient("WhatsMyServer");
MailMessage message = new MailMessage("[email protected]", "[email protected]");
message.Body = "This is a test e-mail message sent by an application. ";
message.Subject = "test message 1";
try
{
client.Send(message);
}
catch(Exception e)
{
Console.Write(e.ToString());
Console.Read();
}
SmtpClient client = new SmtpClient("WhatsMyServer");
MailMessage message = new MailMessage("[email protected]", "[email protected]");
message.Body = "This is a test e-mail message sent by an application. ";
message.Subject = "test message 1";
try
{
client.Send(message);
}
catch(Exception e)
{
Console.Write(e.ToString());
Console.Read();
}
How do i find out what the IP address is for my server and is that my problem?
Tuesday, April 6, 2010 4:35 PM
How do i find out what the correct smtpClient.Host is?
Wednesday, April 7, 2010 7:52 AM
SmtpClient client = new SmtpClient("WhatsMyServer");
MailMessage message = new MailMessage("[email protected]", "[email protected]");
message.Body = "This is a test e-mail message sent by an application. ";
message.Subject = "test message 1";
try
{
client.Send(message);
}
catch(Exception e)
{
Console.Write(e.ToString());
Console.Read();
}
SmtpClient client = new SmtpClient("WhatsMyServer");
MailMessage message = new MailMessage("[email protected]", "[email protected]");
Well if scfm.com is your company then usually smtp.scfm.com is the server. Otherwise you need to contact the email administrator for scfm.com to find out. If you are writing an application to relay email through the smtp host at that domain, then you need to include a security context since most email hosts block relays.