MessageParserConfigHtmlToSimpleHtmlMode Property |
Gets or sets the mode which specifies when the HTML part of the message should be converted into simple HTML (plain text converted into HTML).
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public HtmlToSimpleHtmlAutoConvert HtmlToSimpleHtmlMode { get; set; }
Public Property HtmlToSimpleHtmlMode As HtmlToSimpleHtmlAutoConvert
Get
Set
Property Value
Type:
HtmlToSimpleHtmlAutoConvert
The mode specifying the condition which triggers automatic conversion of the HTML part of the message into simple HTML during parsing the message.
The default value is
Never.
Remarks
Simple HTML represenation can be useful if it's required to get plain-text version of HTML body but display this plain text
in HTML container (such as browser). See
HtmlToSimpleHtmlAutoConvert topic for details.
Examples This sample loads the message from .EML file, converts HTML body into simple HTML format,
and displays it.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
msg.Parser.HtmlToSimpleHtmlMode = HtmlToSimpleHtmlAutoConvert.IfHtml;
msg.Parser.HtmlToSimpleHtmlOptions = HtmlToSimpleHtmlConvertOptions.AddImgAltText;
Console.WriteLine(msg.BodyHtmlText);
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
msg.Parser.HtmlToSimpleHtmlMode = HtmlToSimpleHtmlAutoConvert.IfHtml
msg.Parser.HtmlToSimpleHtmlOptions = HtmlToSimpleHtmlConvertOptions.AddImgAltText
Console.WriteLine(msg.BodyHtmlText)
See Also