Class that contains the data of an IMAP4 BODYSTRUCTURE structure.
For a list of all members of this type, see BodyStructureData Members.
System.Object
BodyStructureData
BodyStructureData is a class that contains the data of an
IMAP4 BODYSTRUCTURE structure.
An IMAP4 FETCH response may optionally contain a BODY or
BODYSTRUCTURE data item, which provides information about the structure
of a message stored on the server. BODYSTRUCTURE has the same fields
as BODY, but adds additional fields. Since BODYSTRUCTURE provides more
information than BODY, this library uses one class,
BodyStructureData, for both IMAP4 structures. In the case of a
BODY structure, some fields of the BodyStructureData instance
are empty.
The BODYSTRUCTURE structure is key to the effective use of IMAP4. One of the significant advantages of IMAP4 over POP3 is the ability to retrieve only the memo text part of a message, without retrieving the attachments. This ability requires the correct interpretation of the information provided in a BODYSTRUCTURE structure.
The contents of a BODYSTRUCTURE structure depend on the MIME media type of the message. In compound types, such as multipart or message/rfc822 types, there may be several nested BODYSTRUCTURE structures. The following table shows which fields are allowed in the BODYSTRUCTURE depending on the media type:
| text | message/rfc822 | multipart | default | |
| media-type | "TEXT" | "MESSAGE" | "MULTIPART" | * |
| media-subtype | * | "RFC822" | * | * |
| content-type-params | * | * | * | * |
| content-id | * | * | * | |
| content-description | * | * | * | |
| content-transfer-encoding | * | * | * | |
| content-length | * | * | * | |
| body-parts | (1) | * | ||
| envelope | * | |||
| number-of-lines | * | * |
(1) A MESSAGE/RFC822 entity contains a single BODYSTRUCTURE structure, which provides information about the encapsulated message.
Note that since certain header fields may not be present in a message, it is possible that some information will not be available, and therefore absent from the BODYSTRUCTURE data returned by the server.
To get the BODYSTRUCTURE information from the IMAP4 server,
first send a FETCH command with a BODY or BODYSTRUCTURE data item. Use
the Imap4Client.Fetch method to
send this command. Then iterate over the returned responses to find
the related FETCH response, represented by an instance of FetchResponse. Get the BodyStructure property to get the contained
instance of BodyStructureData. Finally, extract the information
from the BodyStructureData object.
Namespace: Hunny.Mail
Assembly: Hunny.Mail (in Hunny.Mail.dll)
BodyStructureData Members | Hunny.Mail Namespace | FETCH response in the IMAP4 specification