MailBee.NET Objects 3.1

MailMessage.BodyPlainText Property

Gets or sets the plain-text body of the message.

public string BodyPlainText {get; set;}

Property Value

A string containing the plain-text message body, or an empty string if the message does not have a plain text body.

Remarks

In the case when mail message does not have plain-text body, you can generate it from the HTML body using MakePlainBodyFromHtmlBody method.

Alternatively, to make plain-text version of HTML body of an existing message, you should set MailMessage.Parser.HtmlToPlainMode property to IfNoPlain value. This property must be set BEFORE any property of the MailMessage gets accessed.

Or, for a new message (the one you're composing), to make the outgoing message contain the plain-text body, set MailMessage.Builder.HtmlToPlainMode to IfNoPlain value. This property must be set BEFORE the message gets sent or saved to disk.

Example

The example is available in MailMessage topic.

See Also

MailMessage Class | MailBee.Mime Namespace | BodyHtmlText