MessageParserConfigHtmlToPlainMode Property |
Namespace: MailBee.Mime
Set this property value to IfNoPlain to tell MailBee to automatically generate plain-text version of HTML body if it's not available in the message.
To set additional options of converting HTML into plain text, use HtmlToPlainOptions property.
Note |
---|
MessageParserConfig object cannot be used on its own. To access its members, the developer should use MailMessage.Parser property. |
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Mime; // The actual code (put it into a method of your class). MailMessage msg = new MailMessage(); msg.LoadMessage(@"C:\Docs\TestMail.eml"); msg.Parser.HtmlToPlainMode = HtmlToPlainAutoConvert.IfNoPlain; msg.Parser.HtmlToPlainOptions = HtmlToPlainConvertOptions.AddImgAltText; Console.WriteLine(msg.BodyPlainText);