MimePart Class
Represents a MIME part of the message.
Inheritance Hierarchy
SystemObject
  MailBee.MimeMimePart

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public class MimePart

The MimePart 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 methodCode exampleGetAllParts
Returns the collection containing this MIME part and all its sub-parts (if any) as a flat list.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetRawData
Gets the raw data of the MIME part source.
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 methodStatic memberCode exampleParse
Creates a new instance of MimePart object from the specified MIME data.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyCode exampleBoundary
Gets the string which delimits MIME parts nested into this part.
Public propertyCode exampleCharset
Gets the name of the character encoding of the MIME part.
Public propertyCode exampleContentID
Gets the Content-ID value of the MIME part.
Public propertyCode exampleContentLocation
Gets the content location of the MIME part.
Public propertyCode exampleContentType
Gets the content type of the MIME part as a string.
Public propertyCode exampleDescription
Gets the content description of the MIME part as a string.
Public propertyCode exampleDisposition
Gets the content disposition of the MIME part.
Public propertyCode exampleFilename
Gets the filename of the MIME part as specified in the message.
Public propertyCode exampleHeaders
Gets or sets the collection of the MIME part headers.
Public propertyCode exampleIsComplete
Indicates whether the MIME part of the message was received completely.
Public propertyCode exampleIsFile
Indicates whether the MIME part is a file.
Public propertyCode exampleIsInline
Indicates whether the MIME part is inline.
Public propertyCode exampleIsMessageInside
Indicates whether the MIME part is an encapsulated mail message.
Public propertyCode exampleIsRelated
Indicates whether the MIME part is related to other MIME parts of this message.
Public propertyCode exampleMailEncodingOriginal
Gets the name of the mail transfer encoding of the MIME part.
Public propertyCode exampleName
Gets the name of the MIME part.
Public propertyCode examplePartType
Gets the category of the MIME part content.
Public propertyCode exampleRawHeader
Gets a string containing the header section of the MIME part in the original form.
Public propertyCode exampleSize
Gets the size of the MIME part content in bytes.
Public propertyCode exampleSubParts
Gets the collection of all immediate sub-parts of the MIME part.
Top
Remarks

Each e-mail message consists of one or more MIME parts. Each MIME part consists of a header section and (optionally) a body section. The body section may contain the actual content (text, binary data, etc) or other MIME parts nested into this part. Attachments, text body parts and the message itself are examples of MIME parts.

During parsing the message, MailBee creates a tree of linked MimePart and MimePartCollection objects.

To access the MIME part which corresponds to the message itself (the root part), use MimePartTree property. To access the MIME part which corresponds to a certain attachment, use AsMimePart property of that Attachment object. To access the MIME part which corresponds to a certain text body part, use AsMimePart property of that TextBodyPart object.

Because most properties of MimePart and Attachment object have the same meaning (and every attachment is internally a MIME part - you can get it with Attachment.AsMimePart property), the documentation on these properties usually refers to their versions in Attachment class. Some MimePart properties, however, not applicable or important for Attachment object and thus can only be found in MimePart class.

It's usually not need to create MimePart objects manually. To compose a message consisting of multiple parts, add attachments or text body parts to it. MailBee will produce MIME parts for them during building the message.

However, it's possible to create an instance of MimePart class using Parse(Byte) method.

Examples
The example is available in Boundary topic.
See Also