Dear all,
Please give me solution:
before i used this code it was working.............
string Email = dtUser.Rows[0]["VC_EMAIL"].ToString().Trim();
string uid = Encrypt(dtUser.Rows[0]["IN_ID"].ToString());
string UsName = Encrypt(dtUser.Rows[0]["VC_USERNAME"].ToString());
MailMessage mail = new MailMessage();
mail.To.Add(txtMail.Text.ToString().Trim());
mail.From = new MailAddress("[email protected]");
mail.Subject = "RIDF Reset Password link";
string Body = "
Please Reset your password.... ";
mail.Body = Body;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("[email protected]", "fdafds");
smtp.Port = 587;
//sendEmail(Body, Email);
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = true;
smtp.Send(mail);
return true;
string uid = Encrypt(dtUser.Rows[0]["IN_ID"].ToString());
string UsName = Encrypt(dtUser.Rows[0]["VC_USERNAME"].ToString());
MailMessage mail = new MailMessage();
mail.To.Add(txtMail.Text.ToString().Trim());
mail.From = new MailAddress("[email protected]");
mail.Subject = "RIDF Reset Password link";
string Body = "
Request for Reset Password
Please Reset your password.... ";
mail.Body = Body;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("[email protected]", "fdafds");
smtp.Port = 587;
//sendEmail(Body, Email);
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = true;
smtp.Send(mail);
return true;
but this code is not working now:
showing error -An exception of type 'System.Net.Mail.SmtpException' occurred in System.dll but was not handled in user code
Additional information: Failure sending mail.
Additional information: Failure sending mail.

Ananth GPosted Oct 21, 2016, 5:43 AM
Guest UserPosted Mar 11, 2015, 9:40 AM