TextBodyPart Class
Represents a text body of the message.
Inheritance Hierarchy

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public class TextBodyPart

The TextBodyPart type exposes the following members.

Public methodCode exampleTextBodyPart
Creates a new instance of TextBodyPart object from the specified MimePart object.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAsTextReader
Returns StringReader initialized with the text contents of this body part.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public propertyCode exampleAsMimePart
Gets the text part as MimePart object.
Public propertyCode exampleCharset
Gets or sets the charset of the text part contents.
Public propertyCode exampleHeaders
Gets the collection of the text part headers.
Public propertyIsICalendar
Gets if this body part contains iCal data entry (like meeting request or event).
Public propertyCode exampleIsOriginal
Indicates if the text part came with the message or it was added automatically during parsing the message.
Public propertyCode exampleText
Gets or sets the contents of the text part as a string.
Public propertyCode exampleTransferEncoding
Gets or sets the mail transfer encoding of the text part contents.

The MIME parts of the message can include text parts and attachments.

A MIME part is considered to be a text part if its ContentType starts with text/ and this part is not attachment. For instance, MIME parts of the following content types are text parts:

  • text/plain
  • text/html
  • text/xml
  • text/calendar

To get plain-text body of the message, use BodyPlainText property. To get HTML body, use BodyHtmlText property.

To access all the text parts (in the case if you need specific part, such as XML body if any), use BodyParts property.

The example is available in TextBodyPartCollection topic.
See Also