ImapBodyStructure Class |
Namespace: MailBee.ImapMail
The ImapBodyStructure type exposes the following members.
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetAllParts |
Returns this MIME part and all its subparts as a flat list.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
BodyParams |
Gets the name-value list of body parameters.
| |
Charset |
Gets the charset of the MIME part.
| |
ContentID |
Gets the Content-ID value of the MIME part.
| |
ContentType |
Gets the content-type of the MIME part.
| |
Description |
Gets the description of the MIME part.
| |
Disposition |
Gets the disposition (attachment or inline) of the MIME part.
| |
DispositionParams |
Gets the name-value list of disposition parameters.
| |
EncapsulatedBodyStructure |
Gets the body structure of the attached mail message.
| |
EncapsulatedEnvelope |
Gets the envelope information of the attached mail message.
| |
Filename |
Gets the filename of the MIME part.
| |
IsMultipart |
Indicates if the MIME part is multipart.
| |
Language |
Get the language of the MIME part body.
| |
Location |
Gets the body content URI of the MIME part.
| |
MailEncodingName |
Get the name of content transfer encoding the MIME part body is encoded to.
| |
PartID |
Gets the IMAP4 identifier of this MIME part.
| |
SafeFilename |
Gets the filename of the MIME part, safe for saving to the filesystem under that name.
| |
Size |
Gets the length of encoded body of the MIME part.
| |
SubParts |
Gets the collection of nested parts of the multipart MIME part.
| |
TextLineCount |
Gets the count of text lines of the MIME part of text type.
|
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.