Breaking

Sunday, December 22, 2019

Write code to send e-mail from an ASP.NET application?



MailMessage mailMess = new MailMessage ();
mailMess.From = "abc@gmail.com
 ";
mailMess.To = "xyz@gmail.com";
mailMess.Subject = "Test email";
mailMess.Body = "Hi This is a test mail.";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send (mailMess);

No comments:

Post a Comment