I coded for mailing in the form but now presently its not working, so i asked with my colleague about it, he replied : we cant mail before deployment it wont work. so I want to confirm it ,is it right?
I tried with this below code.
public void sendMail() { try { MailMessage objeto_mail = new MailMessage(); SmtpClient client = new SmtpClient(); client.Port = 25; client.Host = "smtp.internal.elifeindia.in"; client.Timeout = 10000; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential("[email protected]", "9052251772"); objeto_mail.From = new MailAddress("[email protected]"); objeto_mail.To.Add(new MailAddress(txtEmailId.Text)); objeto_mail.Subject = "Password Recover"; objeto_mail.Body = "Message"; client.Send(objeto_mail); } catch (Exception ex) { Response.Write(ex.ToString()); } }
dawood abbasPosted Apr 21, 2015, 3:58 AM
Manoj BhoirPosted Apr 21, 2015, 3:42 AM
What about client.EnableSsl = ?
dawood abbasPosted Apr 21, 2015, 3:41 AM
dawood abbasPosted Apr 21, 2015, 3:38 AM
there throwing an error : Failure sending mail.
Rahul BansalPosted Apr 21, 2015, 3:28 AM
Pradeep ShetPosted Apr 21, 2015, 3:27 AM
He said that way because may be that smtp server is accessible from the deployment server only and not from your system.