Note that I have another site with the exact same code. the only difference is the ConectionString and the emails, and it works fine. I don't understand. Can someone shed a light? Thank you
But it does not work. I have the below error:
Server Error in '/ACS_Webcast' Application.
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
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.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1028066
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431
[WebException: Unable to connect to the remote server]
System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +1475352
System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +190
System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +318
System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +227
System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +316
System.Net.Mail.SmtpClient.GetConnection() +42
System.Net.Mail.SmtpClient.Send(MailMessage message) +1485
[SmtpException: Failure sending mail.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +2074
Registration.Register(Object sender, EventArgs e) +5884
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
public
void MailSend(String mailAddress,String UserName,String
Password)
{
System.Net.Mail.SmtpClient client =
new System.Net.Mail.SmtpClient("mail.sitename.org", 25);
System.Net.Mail.
MailMessage msg =
new System.Net.Mail.MailMessage(
"mail@sitename.org",
mailAddress,
"User Name and password",
" This is your User Name: "+ UserName +" and Password: "+ Password +
" for accessing Tokau blog");
msg.IsBodyHtml = true;msg.ReplyTo =
new System.Net.Mail.MailAddress("mail@sitename.org",
"User Name and password send");
Based on my understanding, when you send email in your asp.net application, you get the error message above. If I have misunderstood you, please feel free to let me know.
The code that is used to send the email works fine on another website, which indicates that the code is correct.
To better understand your issue, could you please confirm the following information:
<div mce_keep="true">Please make sure that the server is running and the ConectionString is correct.</div>
<div mce_keep="true">Please make sure that we can connect to the mail server. Sometimes firewalls or proxy servers can get in the way.</div>
<div mce_keep="true">If we change the mailFrom and mailTo to the address that exists on the email server, does it have the same issue?</div>
I hope this helps.
Thomas Sun
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
i have the same exact code (except the connect string and the email address) running on the web server of the same provider. I took the code from domain1.com (the running code) and move it to domain2.com, made modification to the connectString, the email and
password. I am not sure why it does not work.
jacthemanus
0 Points
27 Posts
Connection attempt failed
Oct 31, 2007 04:32 AM|LINK
Hello,
I am trying to send email from my web site. My code is on Godaddy.com web server.
Here is a piece of code form my registration page:
...
MailAddress mailFrom = new MailAddress(organizer@apothecarecolsvc.org, "ACS Webcast Administrator");MailAddress mailTo = new MailAddress(Email.Text.Trim(), FirstName.Text.Trim() + " " + LastName.Text.Trim());
MailMessage mailMessage = new MailMessage(mailFrom, mailTo);
mailMessage.Subject = Webcast.SelectedItem.Text;
mailMessage.Body = "Thank you for registering the " + Webcast.SelectedItem.Text + " webcast.\n\n" +
... SmtpClient mailClient = new SmtpClient();
mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
mailClient.Send(mailMessage);
I also setup my web.config to match Godaddy.com requirements:
<system.net>
<mailSettings>
<smtp from=organizer@apothecarecolsvc.org>
<network host="smtpout.secureserver.net" password="mypwd" userName=organizer@apothecarecolsvc.org />
</smtp>
</mailSettings>
</system.net>
Note that I have another site with the exact same code. the only difference is the ConectionString and the emails, and it works fine. I don't understand. Can someone shed a light? Thank you
But it does not work. I have the below error:
Server Error in '/ACS_Webcast' Application.
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
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.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Source Error:
Stack Trace:
sandeepthekk...
Member
563 Points
165 Posts
Re: Connection attempt failed
Oct 31, 2007 10:10 AM|LINK
{
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("mail.sitename.org", 25);System.Net.Mail.
MailMessage msg = new System.Net.Mail.MailMessage( "mail@sitename.org",mailAddress,
"User Name and password", " This is your User Name: "+ UserName +" and Password: "+ Password + " for accessing Tokau blog"); msg.IsBodyHtml = true;msg.ReplyTo = new System.Net.Mail.MailAddress("mail@sitename.org", "User Name and password send");client.Send(msg);
lblMessage.Text = "Mail Send..";}
Thomas Sun –...
All-Star
64969 Points
5621 Posts
Re: Connection attempt failed
Nov 02, 2007 06:58 AM|LINK
Hi,
Based on my understanding, when you send email in your asp.net application, you get the error message above. If I have misunderstood you, please feel free to let me know.
The code that is used to send the email works fine on another website, which indicates that the code is correct.
To better understand your issue, could you please confirm the following information:
I hope this helps.
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
jacthemanus
0 Points
27 Posts
Re: Connection attempt failed
Nov 02, 2007 08:27 PM|LINK
Thomas Sun,
i have the same exact code (except the connect string and the email address) running on the web server of the same provider. I took the code from domain1.com (the running code) and move it to domain2.com, made modification to the connectString, the email and password. I am not sure why it does not work.