Gets or sets whether the message headers should be returned as HTML.
true if the message headers should be returned in HTML-encoded form; false if they should be returned as-is. The default value is false.
If this property is set to true, all MailMessage properties representing the message headers (like RawHeader, To, From, Subject, etc) will return their values HTML encoded. For instance, ">" will be returned as ">".
This can be useful when printing values of MailMessage properties into HTML container (such as browser).
This property has immediate effect. There is no need to ever call Apply after changing its value.
Note MessageParserConfig object cannot be used on its own. To access its members, the developer should use MailMessage.Parser property.
This sample creates a new message, sets To field and displays its value both HTML-encoded and as-is.
[C#] // To use the code below, import these namespaces at the top of your code. using System; using MailBee; using MailBee.Mime; // The actual code (put it into a method of your class). MailMessage msg = new MailMessage(); msg.To.AsString = "John Doe <jdoe@domain.com>"; Console.WriteLine("HTML Encoding off: " + msg.To.ToString()); msg.Parser.HeadersAsHtml = true; Console.WriteLine("HTML Encoding on: " + msg.To.ToString());
[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.To.AsString = "John Doe <jdoe@domain.com>" Console.WriteLine("HTML Encoding off: " & msg.To.ToString()) msg.Parser.HeadersAsHtml = True Console.WriteLine("HTML Encoding on: " & msg.To.ToString())
MessageParserConfig Class | MailBee.Mime Namespace