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);

Post a Comment

0 Comments