Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (22 sloc) 916 Bytes
Scaffold Mailer InvitationMailer InviteFriend
<smtp from="mvcmailer@smsohan.com">
<network enableSsl="true" host="smtp.gmail.com" port="587" userName="mvcmailer@smsohan.com" password="mvcmailer" />
</smtp>
public virtual MailMessage InviteFriend(Invitation invitation)
{
var mailMessage = new MailMessage{Subject = "Invitation from TravelTo"};
mailMessage.To.Add(invitation.FriendEmail);
ViewBag.Invitation = invitation;
PopulateBody(mailMessage, viewName: "InviteFriend");
return mailMessage;
}
<h1>TravelTo Invitation<h1>
Hi <strong>@ViewBag.Invitation.FriendName:</strong><br />
Your friend @ViewBag.Invitation.Name invited you to TravelTo. He also wrote this message.<br />
<br />
<i>@ViewBag.Invitation.InvitationMessage</i>
<br />
@Url.Abs(Url.Action("Index", "Home"))
using TravelTo.Mailers;
using Mvc.Mailer;
new InvitationMailer().InviteFriend(invitation).Send();