Twisted Bits

a blog by jeff lafay, software developer

C# posts

December 20, 2011 StackOverflow that I answered. Building email message content via string concats can be a huge pain to implement (not to mention pretty boring). 

My method for email templating with C# is sweet and simple. It works by reading the text from a template file at runtime, retrieving a model object, and then passing both to the Razor parser to render the needed email body with the model property values populated. Since the templates are read at runtime, small cosmetic tweaks to your email templates are easy.  

Here's a breakdown of what you need 

">Leveraging Razor for Email Content Templating