I am using MVC Mailer - but for some reason when the view is rendered there is nothing in ViewBag. My code looks like this
ViewBag.test = "This should appear in the view";
MvcMailMessage m = new MvcMailMessage();
MailerBase mb = new MailerBase();
m = mb.Populate(x =>
{
x.Subject = "Welcome";
x.ViewName = "../Mails/Email_ForgotPassword";
x.To.Add("g@gmail.com");
});
m.Send();
ModelState.AddModelError("", "Success! Password sent");
I can only imagine that it is some weird setting or something I have omitted - because ViewBag.test in the view is NULL.
Any help much appreciated!