1
Answer

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

Sundas Ali

Sundas Ali

8y
349
1
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)