MessageParserConfigHeadersAsHtml Property |
Namespace: MailBee.Mime
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. |
// 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());