Sundas Ali

Sundas Ali

  • NA
  • 7
  • 6.9k

I'm getting this error on System.Net.Mail.SmtpException:

Jul 13 2016 5:04 PM
MailMessage mail = new MailMessage();
string Subject = "User Inquery";
mail.To.Add("[email protected]");
mail.From = new MailAddress("user[email protected]", "Sundas");
mail.Subject = Subject.Trim();
mail.Body += "Dear Administrator,<br><br>.";
mail.Body += "User Emial: " + Email.Text + "<br>";
mail.Body += "User Message: " + txtBody.Text + "<br><br>";
mail.Body += "Thanks & Regards<br>";
mail.Body += txtName.Text;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.mail.yahoo.com";
smtp.Port = 465;
smtp.Credentials = new System.Net.NetworkCredential("user[email protected]", "*****");
smtp.EnableSsl = true;
smtp.Send(mail);

Answers (1)