Last post Mar 13, 2015 03:25 AM by val-10
Mar 13, 2015 03:25 AM|val-10|LINK
I am trying to use Hangfire to send emails by using Postal library.
However, I have an issue with it.
My code is:
var viewsPath = System.IO.Path.GetFullPath(System.Web.Hosting.HostingEnvironment.MapPath(@"~/Views/Emails"));
var engines = new System.Web.Mvc.ViewEngineCollection();
var service = new EmailService(engines);
dynamic email = new Email("Test");
email.To = "email@example.com";
email.Name = "test name";
I am getting error in the final line of the code:
service.Send(email);The Error I get is:Activation error occurred while trying to get all instances of type IViewEngineValue cannot be null.\r\nParameter name: httpContextThanks for your help