WebMail

try {

      WebMail.SmtpServer = "smtp.example.com";

     WebMail.SmtpPort = 587;

     WebMail.EnableSsl = true;

     WebMail.UserName = "mySmtpUsername";

     WebMail.Password = "mySmtpPassword";

     WebMail.From = "[email protected]";

     WebMail.Send("[email protected]", "RSVP Notification",

     Model.Name + " is " + ((Model.WillAttend ?? false) ? "" :

     "not")

     + "attending");

} catch (Exception) {

     @:<b>Sorry - we couldn't send the email to confirm your RSVP.

     </b>

}

 

你可能感兴趣的:(mail)