Generating HTML email body in C#

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2009-05-20T08:07:27Z Indexed on 2010/03/13 22:55 UTC
Read the original article Hit count: 552

Filed under:
|
|

Is there a better way to generate HTML email in C# (for sending via System.Net.Mail), than using a Stringbuilder to do the following:

string userName = "John Doe";
StringBuilder mailBody = new StringBuilder();
mailBody.AppendFormat("<h1>Heading Here</h1>");
mailBody.AppendFormat("Dear {0}," userName);
mailBody.AppendFormat("<br />");
mailBody.AppendFormat("<p>First part of the email body goes here</p>");

and so on, and so forth?

© Stack Overflow or respective owner

Related posts about c#

Related posts about email