TextBodyPartIsOriginal Property |
Namespace: MailBee.Mime
If the message does not have plain-text or HTML body, Parser object can be configured to tell MailBee to generate such a body (in fact, create the corresponding TextBodyPart) during parsing. MailBee will place automatically created parts of the message into BodyParts collection.
Also, the developer can manually add a text part into BodyParts collection using its methods.
The scenarios listed above will produce TextBodyPart objects having IsOriginal set to false.
// 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) // Load plain-text message and make HTML body automatically. MailMessage msg = new MailMessage(); msg.LoadMessage(@"C:\Docs\PlainTextEmail.eml"); msg.Parser.PlainToHtmlMode = PlainToHtmlAutoConvert.IfPlain; // Report plain-text and HTML parts origin. Console.WriteLine("Plain part IsOriginal = " + msg.BodyParts.Plain.IsOriginal.ToString()); Console.WriteLine("HTML part IsOriginal = " + msg.BodyParts.Html.IsOriginal.ToString());