Hi dear all
This my code that i wrote it
MailMessage msg = new MailMessage();
msg.From = new MailAddress("noreply@educclip.com", "My site Registratration");
msg.To.Add(new MailAddress(email, name, System.Text.Encoding.UTF8));
msg.Subject = "Educclip - Register Account";
msg.IsBodyHtml = true;
msg.DeliveryNotificationOptions = DeliveryNotificationOptions.None;
msg.Priority = MailPriority.Normal;
StreamReader sr = new StreamReader(Server.MapPath("~/ActiveMail.htm"));
string temp = sr.ReadToEnd();
temp = temp.Replace("[###Name###]", name).Replace("[###Url###]", key);
msg.Body = temp;
SmtpClient smtp = new SmtpClient("mail.educclip.com");
System.Net.NetworkCredential perm = new System.Net.NetworkCredential("noreply@educclip.com", "My host email's password");
smtp.Credentials = perm;
smtp.Send(msg);
it seems that it must work
but at the smtp.Send(msg) part i receive the error that email failed to send.
Is there any one to help me?
Thanks alot
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 110.4.46.160:25]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +225
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +279
[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) +6054548
System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +314
System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +322
System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) +146
System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) +170
System.Net.Mail.SmtpClient.GetConnection() +50
System.Net.Mail.SmtpClient.Send(MailMessage message) +1484
[SmtpException: Failure sending mail.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +1811
NewUser.SendEmail(String email, String name, String key) in g:\Programming\Projects\Educclip2\Educclip Website(Mysql)\NewUser.aspx.cs:99
NewUser.SignupBtn_Click(Object sender, EventArgs e) in g:\Programming\Projects\Educclip2\Educclip Website(Mysql)\NewUser.aspx.cs:69
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563