.net Email Template engine

Alex picture Alex · Sep 24, 2009 · Viewed 14.7k times · Source

I'm looking to create emails, mainly HTML, based on templates - I'd really like to do something like:

  1. Set up my template, as an HTML (or similar) file
  2. Include tags, that are then replaced with specific data (kind of like mail-merge....)

I've seen this: http://www.bitethebullet.co.uk/EmailTemplateFramework/tabid/58/Default.aspx

From searching on stack overflow, i understand nVelocity might be another option? But i can't find any examples to do what i want to do...

Any other suggestions?

Answer

RichardOD picture RichardOD · Sep 24, 2009

This kind of functionality is already built in. See MailDefinition class. For more complex scenarios you might want to consider something like NVelocity. I've had a lot of success with StringTemplate's C# port.