I am using MVCMailer and trying to send mail from WebApi, but mail always arrives with an empty message.
view is in /Views/Account/CreateUser.cshtml
and this is my code
public class Account: MailerBase
{
public MvcMailMessage CreateUser(CreateNewAccount model)
{
return Populate(x =>
{
x.Subject = model.Subject;
x.ViewName = "CreateUser";
x.To.Add(model.Email);
ViewData.Model = model;
});
}
When I send an email from the classic MVC controller, email arrives properly, but send from APiControler mail body is empty.
[RESOLVE] View must be in main Views folder, NOT in an Area. In my situation /Views/Account/CreateUser.cshtml