MessageParserConfigHtmlToPlainMode Property
Gets or sets the mode which specifies if the HTML body should be automatically converted into the plain text.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public HtmlToPlainAutoConvert HtmlToPlainMode { get; set; }

Property Value

Type: HtmlToPlainAutoConvert
The mode which specifies the condition which triggers automatic conversion of HTML body into plain-text body during parsing the message. The default value is Never.
Remarks

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 Note
MessageParserConfig object cannot be used on its own. To access its members, the developer should use MailMessage.Parser property.
Examples
This sample loads the message from .EML file and tells MailBee to automatically create plain-text version from HTML version if no plain-text version is available. Also, the conversion process is tuned so that the contents of ALT attributes of <IMG> tags would appear in the generated plain text.
// 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);
See Also