Skip to content

Instantly share code, notes, and snippets.

public class MailSender
{
// Call this from Application_Start in Global.asax.cs
public static void Init()
{
var viewRenderer = new EmailViewRenderer(ViewEngines.Engines) {EmailViewDirectoryName = "Emails"};
var emailParser = new EmailParser(viewRenderer);
Email.CreateEmailService = ()=>new EmailService(viewRenderer, new PremailerEmailParser(emailParser), ()=>new SmtpClient());
}
public class Global : System.Web.HttpApplication {
protected void Application_Start(object sender, EventArgs e) {
var store = new SmartMessageStore();
DependencyResolver.Register(typeof(IMessageStore), () => store);
}
}