Gets or sets if the plain-text body of the message should be automatically converted into HTML.
The mode specifying the condition which triggers automatic conversion the plain-text body of the message into HTML. The default value is Never.
You may need to set this property in order to display plain-text message in an HTML container (such as browser).
To set additional options for coverting plain text into HTML, use HtmlToPlainOptions property.
Note MessageParserConfig object cannot be used on its own. To access its members, the developer should use MailMessage.Parser property.
This sample loads the message from .EML file, converts its plain-text body into HTML if the HTML body is not available in the message, and displays the HTML body.
[C#] // 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.PlainToHtmlMode = PlainToHtmlAutoConvert.IfNoHtml; msg.Parser.PlainToHtmlOptions = PlainToHtmlConvertOptions.UriToLink; Console.WriteLine(msg.BodyHtmlText);
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.Mime ' The actual code (put it into a method of your class). Dim msg As New MailMessage msg.LoadMessage("C:\Docs\TestMail.eml") msg.Parser.PlainToHtmlMode = PlainToHtmlAutoConvert.IfNoHtml msg.Parser.PlainToHtmlOptions = PlainToHtmlConvertOptions.UriToLink Console.WriteLine(msg.BodyHtmlText)
MessageParserConfig Class | MailBee.Mime Namespace | PlainToHtmlOptions