MessageParserConfigCharsetMetaTagMode Property |
Namespace: MailBee.Mime
This property can be used to enable modification of <META> containing the charset specification of the HTML body. HTML messages often contain tags like <META content="xxxxxx; charset=xxxxxx">. However, if the application displays everything in another charset (usually, UTF-8), this charset specification will no longer be valid. It's recommended to remove it from the body by setting CharsetMetaTagMode to RemoveCharsetMetaTag before the message gets parsed. When no charset is specified in <META> tag, the client browser will obtain it from the web page header where it will already be correctly specified by ASP.NET engine.
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 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.CharsetMetaTagMode = CharsetMetaTagProcessing.SetCorrectCharset; msg.Parser.Apply();