Free Support Forum -

Get TextBody from HtmlBody


Is there a way I can get the Text Body from the Html Body?


Hi Trent,

The TextBody property of MailMessage can be used to get the Text Body representation of the HtmlBody of a message as follow:

MailMessage msg = MailMessage.Load(“Test text body.msg”);<o:p></o:p>

Console.WriteLine("HTML Body: " + msg.HtmlBody);

Console.WriteLine("Text Body: " + msg.TextBody);

Please feel free to contact us if you have any additional query/inquiry related to Aspose.Email.