e.g. 3.16 Using the WebMail Helper
parent
abbbe0c54d
commit
15363a0ae7
|
@ -11,6 +11,24 @@
|
||||||
<title>Thanks</title>
|
<title>Thanks</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WebMail.SmtpServer = "smtp.example.com";
|
||||||
|
WebMail.SmtpPort = 586;
|
||||||
|
WebMail.EnableSsl = true;
|
||||||
|
WebMail.UserName = "mySmtpUsername";
|
||||||
|
WebMail.Password = "mySmtpPassword";
|
||||||
|
WebMail.From = "rsvp@example.com";
|
||||||
|
WebMail.Send("party-host@example.com", "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>
|
||||||
|
}
|
||||||
|
}
|
||||||
<div>
|
<div>
|
||||||
<h1>Thank you, @Model.Name</h1>
|
<h1>Thank you, @Model.Name</h1>
|
||||||
@if (Model.WillAttend == true)
|
@if (Model.WillAttend == true)
|
||||||
|
|
Loading…
Reference in New Issue