ImapBodyStructure Class
Represents a structure of a MIME part of a mail message.
Inheritance Hierarchy
SystemObject
  MailBee.ImapMailImapBodyStructure

Namespace: MailBee.ImapMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public class ImapBodyStructure

The ImapBodyStructure type exposes the following members.

Methods
  NameDescription
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 methodGetAllParts
Returns this MIME part and all its subparts as a flat list.
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.)
Top
Properties
  NameDescription
Public propertyBodyParams
Gets the name-value list of body parameters.
Public propertyCharset
Gets the charset of the MIME part.
Public propertyContentID
Gets the Content-ID value of the MIME part.
Public propertyContentType
Gets the content-type of the MIME part.
Public propertyDescription
Gets the description of the MIME part.
Public propertyDisposition
Gets the disposition (attachment or inline) of the MIME part.
Public propertyDispositionParams
Gets the name-value list of disposition parameters.
Public propertyEncapsulatedBodyStructure
Gets the body structure of the attached mail message.
Public propertyEncapsulatedEnvelope
Gets the envelope information of the attached mail message.
Public propertyFilename
Gets the filename of the MIME part.
Public propertyIsMultipart
Indicates if the MIME part is multipart.
Public propertyLanguage
Get the language of the MIME part body.
Public propertyLocation
Gets the body content URI of the MIME part.
Public propertyMailEncodingName
Get the name of content transfer encoding the MIME part body is encoded to.
Public propertyPartID
Gets the IMAP4 identifier of this MIME part.
Public propertySafeFilename
Gets the filename of the MIME part, safe for saving to the filesystem under that name.
Public propertySize
Gets the length of encoded body of the MIME part.
Public propertySubParts
Gets the collection of nested parts of the multipart MIME part.
Public propertyTextLineCount
Gets the count of text lines of the MIME part of text type.
Top
Remarks

The IMAP4 protocol allows the client to query information about all MIME parts of a mail message without downloading the entire message. The server returns this information as a tree of body structures, where each body structure describes the corresponding MIME part and contains a list of nested body structures if the corresponding MIME part is multipart.

The common use of body structures is to list attachments of a mail message (see the sample code in Envelope topic). Another case is processing envelopes of international messages, because body structures contain charset settings of mail messages. When a body structure of a certain message is available, MailBee is able to decode the message envelope fields containing international characters more correctly.

When an entire message is downloaded, there is no need to download its body structure since all the required information is already available in the message data.

To access body structure information, the developer should request receiving body structures from the server when calling DownloadEnvelopes(String, Boolean, EnvelopeParts, Int32, String, String) method by setting BodyStructure flag in parts parameter value. A reference to the ImapBodyStructure object representing the root MIME part of the mail message can then be obtained via BodyStructure property value.

By default, MailBee represents the body structure tree as a branching linked list. This reflects nested nature of MIME parts. However, it's often more convenient to get this tree as a simple collection. MailBee provides GetAllParts method for this.

See Also