Posts

Showing posts from November, 2010

3 Ways to Send Emails with dynamic content in ASP.NET

To send email from asp.net application, we have followed various approaches in past 1. Create & design HTML file, Use place holder to find and replace. Pros: If you are sending one type of email. Easy to test the layout in different browsers. Cons: if you are sending multiple types of email but for email format or layout is same. Difficult to maintain Performance slow, due to disk read operation. Difficult to Test in different browser with dynamic data. 2. Create XSLT file, transform by passing your custom object. Pros: if you know xslt and only one type of email you want to send. Cons: Xslt knowledge is required Difficult to maintain, If you have to send multiple type of dynamic email content with same email format or layout. Very difficult to debug. Some Performance hit. 3. Create two asp.net User controls, one master user control & one is child user control. Master user control will be similar to asp.net master page. To keep email outer email body template in one location.