Mail Templates for ASP.NET MVC

I was working on an MVC project recently, and wanted to use templates for formatting emails.  Scott Hanselmann recommends MvcMailer in this post.  I gave it try, but it has a couple dependencies on other projects, and I wanted to keep it simple and pragmatic for this small project.  

I ended up using ActionMailer.Net which uses two of its own dlls and no external dependencies.  ActionMailer worked for my needs and uses standard views, either .aspx or Razor view files.

Prior to MVC, in web forms, I built an Email Templater, which allowed me to create a new model for each email view, but I had to point the templater to the correct template file location.  ActionMailer is essentially an extension of the MVC ControllerBase class, so all you need to do is place your view files in the View folder of your site.

For my needs it worked, but it is a very basic email requirement I have, so it is possible I may run into obstacles.  But, so far so good.

Tags: