When i am sending mail using ActionMailer.Net.Mvc getting a error "Value does not fall within the expected range." below is code.
var context = System.Web.HttpContext.Current;
Task.Factory.StartNew(() =>
{
System.Web.HttpContext.Current = context;
new MailController().NewsLetter("[email protected]", objNewsModel).Deliver();
});
public class MailController : MailerBase
{
public EmailResult NewsLetter(string EmailAddress, NewsModel objNewsModel)
{
To.Clear();
To.Add(EmailAddress);
BCC.Add("[email protected]");
From = "[email protected]";
Subject = "Latest News";
return Email("NewsLetter", objNewsModel);
//this (return Email("NewsLetter", objNewsModel);)line giving a error 'Value does not fall within the expected range.'
}
}