Setting the E-Mail Format

One advantage of most e-mail readers is their capability to process HTML formatting within the message body. This enables an e-mail to present itself just like a Web page. The System.Web.Mail namespace contains a format object called MailFormat with two enumerated types: Text or HTML. To set the MailMessage format property just assign it a value from the MailFormat object as follows:

mailObj.BodyFormat = MailFormat.Text 

or

mailObj.BodyFormat = MailFormat.HTML 

Get Special Edition Using® Microsoft® ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.