Unable to send mail by using ASP.Net 2.0
-
Hello Frends I m using ASP.Net 2.0 and trying to send mail but its showing me error ... Error Message is --Mailbox unavailable. The server response was: 5.7.1 Unable to relay for dineshsharmain@gmail.com my code is -- in web.config - and in .CS File - try { MailMessage message = new MailMessage(); message.From = new MailAddress(txtEMailFrom.Text); message.To.Add(new MailAddress("dineshsharmain@gmail.com")); message.Subject = txtSubject.Text; message.Body = txtMsg.Text; SmtpClient client = new SmtpClient(); client.Send(message); lblMsg.Text = DeliveryNotificationOptions.OnSuccess.ToString(); } catch (SmtpException ex) { lblMsg.Text = ex.Message + " " + ex.InnerException; } Thanx Dinesh Sharma
-
Hello Frends I m using ASP.Net 2.0 and trying to send mail but its showing me error ... Error Message is --Mailbox unavailable. The server response was: 5.7.1 Unable to relay for dineshsharmain@gmail.com my code is -- in web.config - and in .CS File - try { MailMessage message = new MailMessage(); message.From = new MailAddress(txtEMailFrom.Text); message.To.Add(new MailAddress("dineshsharmain@gmail.com")); message.Subject = txtSubject.Text; message.Body = txtMsg.Text; SmtpClient client = new SmtpClient(); client.Send(message); lblMsg.Text = DeliveryNotificationOptions.OnSuccess.ToString(); } catch (SmtpException ex) { lblMsg.Text = ex.Message + " " + ex.InnerException; } Thanx Dinesh Sharma
Review this link:- http://www.codecomments.com/ASP_.NET/message857135.html[^] :) Thanks and regards, Suresh Dayma
Everything Is Possible!