Developers use the following syntax code to send email from an ASP.NET application:

 

  • MailMessagemailMess = new MailMessage ();
  • mailMess.From = "admin@bestinterviewquestion.com"
  • mailMess.To = "info@bestinterviewquestion.com"
  • mailMess.Subject = "Test email";
  • mailMess.Body = "Hi This is a test mail for bestinterviewquestion.";
  • SmtpMail.SmtpServer = "localhost";
  • SmtpMail.Send (mailMess);

Suggest An Answer

No suggestions avaliable!