, , Thanks.cshtml, , . , Index.cshtml. , , . Razor , .
@model PartyInvites.Models.GuestResponse @{ Layout = null;} <!DOCTYPE html><html><head><metaname="viewport"content="/><title>Thanks</title><linkhref="~/Content/bootstrap.css"rel="stylesheet" /><linkhref="~/Content/bootstrap-theme.css"rel="stylesheet" /><style>body{ background:#f1f1f1; }</style></head><body><divclass="text-center"><h1>, @Model.Name!</h1><divclass="lead"> @if (Model.WillAttend == true){ @: , ;) }else { @: , . }</div></div></body></html>lead Bootstrap. :
RSVP . , , .NET Framework - MVC.
WebMail. MVC, , . , Thanks. :
@modelPartyInvites.Models.GuestResponse @{Layout = null;} <!DOCTYPE html><html><head><metaname="viewport"content="/><title>Thanks</title><linkhref="~/Content/bootstrap.css"rel="stylesheet" /><linkhref="~/Content/bootstrap-theme.css"rel="stylesheet" /><style>body{ background:#f1f1f1; }</style></head><body> @{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 ",Model.Name + ((Model.WillAttend?? false)? " ": "") + ""); }catch (Exception) { @:<b> .</b>} }<divclass="text-center"><h1>, @Model.Name!</h1><divclass="lead"> @if (Model.WillAttend == true){ @: , ;) }else { @: , . }</div></div></body></html>WebMail , . , .
|
|
Razor, WebMail , , (SSL) . , WebMail.Send() .
try...catch, , . Thanks. , MVC.