Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

mvcConf 2 - Andrew Davey: Going Postal - Generating email with View Engines

Download

Right click “Save as…”

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.

Follow the Discussion

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.