The .NET framework provides a simple API for sending email. I assume you are already acquainted with the handy namespace System.Net.Mail. However, dynamically generating the content of an email is still a bit tricky. Code that concatenates strings and variables is no fun to write or read! What we need is a way to write text (or html) templates which will be rendered with some data. ASP.NET MVC already has exactly this in the form of Views. So let's reuse the view engine infrastructure to create our emails. I created a simple library called Postal that does just that. This session will introduce Postal and walk through using the library.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.