I'm porting some VBScript code which generates emails using the standard CDOSYS Message object. The Message oject has a property AutoGenerateTextBody
which when true will cause it to automatically create the TextBody
property value when you assign HTML to the HTMLBody
property. Hence creating the typical text/plain and text/html alternatives in the message body.
However .NET appears to be missing this function. The MailMessage
object does have the ability to create alternative views but there doesn't appear to be a way to easily create the text body content from the HTML content.
I'm not necessarily looking for an auto-magic option but I do need a solution to taking what is an HTML string and converting it to a reasonable plain text representation. Just dropping all the HTML markup doesn't cut it.
Is there a tool buried somewhere in the existing .NET framework that can do this?