#24 Automatic Text Body Population from HTML Body

open
nobody
None
5
2005-09-08
2005-09-08
Olli-Pekka Isola
No

Hi,

I would be very pleased if there is a easy way to
populate Body -property based on the value of
HtmlBody -property. There is two ways of accomplishing
it:

A) integrate text redition (76 character wide column) of
HTML content
B) refer to external (3rd party) dotnet class in
documentation that can be used to convert HTML code
to text with layout

If method A is used then new or modified properties
could be following:

' populates MailMessage.Body from data in
' MailMessage.HtmlBody
MailMessage.RenderAsText()

' reads HTML content from file and populates both
' MailMessage.HtmlBody and MailMessage.Body
MailMessage.GetHtmlBodyFromFile(string filePath,
boolean renderAsText)

Text based HTML bworser Lynx has text rendition built-
in as well as all popular GUI web brosed that expose
File | Save As funtionality. The usually offer text as one
target format.

Regards,
Olli-Pekka Isola

Discussion