TextBodyPartCollectionPlain Property |
Gets a reference to the plain-text part of the message.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public TextBodyPart Plain { get; }
Public ReadOnly Property Plain As TextBodyPart
Get
Property Value
Type:
TextBodyPart
A reference to
TextBodyPart object representing the plain-text body and its headers.
Remarks If the message contains more than one plain-text body, this property will return the first found.
If the message does not contain plain-text body, accessing this property will create new one.
If the above behaviour is not suitable for your case, you can always iterate through the collection
and examine each text part as it appears in the message.
Examples This sample creates a new message with the plain-text body and saves it to disk.
In real-world apps, however, it would be easier to set plain-text body contents using
BodyPlainText property.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.BodyParts.Plain.Text = "Hello, World!";
msg.SaveMessage(@"C:\Docs\TestMail.eml");
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.BodyParts.Plain.Text = "Hello, World!"
msg.SaveMessage("C:\Docs\TestMail.eml")
See Also