Click or drag to resize
MimeKit

Multipart Class

A multipart MIME entity which may contain a collection of MIME entities.
Inheritance Hierarchy

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 2.0.7.0
Syntax
C#
public class Multipart : MimeEntity, ICollection<MimeEntity>, 
	IEnumerable<MimeEntity>, IEnumerable, IList<MimeEntity>

The Multipart type exposes the following members.

Constructors
  NameDescription
Public methodMultipart
Initializes a new instance of the Multipart class.
Public methodMultipart(String)
Initializes a new instance of the Multipart class.
Public methodMultipart(MimeEntityConstructorArgs)
Initializes a new instance of the Multipart class.
Public methodMultipart(String, Object)
Initializes a new instance of the Multipart class.
Top
Properties
  NameDescription
Public propertyBoundary
Gets or sets the boundary.
Public propertyContentBase
Gets or sets the base content URI.
(Inherited from MimeEntity.)
Public propertyContentDisposition
Gets or sets the content disposition.
(Inherited from MimeEntity.)
Public propertyContentId
Gets or sets the content identifier.
(Inherited from MimeEntity.)
Public propertyContentLocation
Gets or sets the content location.
(Inherited from MimeEntity.)
Public propertyContentType
Gets the type of the content.
(Inherited from MimeEntity.)
Public propertyCount
Gets the number of parts in the multipart.
Public propertyEpilogue
Gets or sets the epilogue.
Public propertyHeaders
Gets the list of headers.
(Inherited from MimeEntity.)
Public propertyIsAttachment
Gets a value indicating whether this MimePart is an attachment.
(Inherited from MimeEntity.)
Public propertyIsReadOnly
Gets a value indicating whether this instance is read only.
Public propertyItem
Gets or sets the MimeEntity at the specified index.
Public propertyPreamble
Gets or sets the preamble.
Top
Methods
  NameDescription
Public methodAccept
Dispatches to the specific visit method for this MIME entity.
(Overrides MimeEntityAccept(MimeVisitor).)
Public methodAdd
Adds the specified part.
Public methodClear
Clears the multipart.
Public methodContains
Checks if the Multipart contains the specified part.
Public methodCopyTo
Copies all of the entities in the Multipart to the specified array.
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 methodGetEnumerator
Gets the enumerator for the children of the Multipart.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIndexOf
Gets the index of the specified part.
Public methodInsert
Inserts the part at the specified index.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnHeadersChanged
Called when the headers change in some way.
(Inherited from MimeEntity.)
Public methodPrepare
Prepare the MIME entity for transport using the specified encoding constraints.
(Overrides MimeEntityPrepare(EncodingConstraint, Int32).)
Public methodRemove
Removes the specified part.
Public methodRemoveAt
Removes the part at the specified index.
Protected methodRemoveHeader
Removes the header.
(Inherited from MimeEntity.)
Protected methodSetHeader(String, Byte)
Sets the header using the raw value.
(Inherited from MimeEntity.)
Protected methodSetHeader(String, String)
Sets the header.
(Inherited from MimeEntity.)
Public methodToString
Returns a String that represents the current MimeEntity.
(Inherited from MimeEntity.)
Protected methodTryInit
Tries to use the given object to initialize the appropriate property.
(Inherited from MimeEntity.)
Public methodWriteTo(Stream, CancellationToken)
Write the MimeEntity to the specified output stream.
(Inherited from MimeEntity.)
Public methodWriteTo(String, CancellationToken)
Writes the MimeEntity to the specified file.
(Inherited from MimeEntity.)
Public methodWriteTo(Stream, Boolean, CancellationToken)
Write the MimeEntity to the specified output stream.
(Inherited from MimeEntity.)
Public methodWriteTo(String, Boolean, CancellationToken)
Write the MimeEntity to the specified file.
(Inherited from MimeEntity.)
Public methodWriteTo(FormatOptions, Stream, CancellationToken)
Write the MimeEntity to the specified output stream.
(Inherited from MimeEntity.)
Public methodWriteTo(FormatOptions, String, CancellationToken)
Write the MimeEntity to the specified file.
(Inherited from MimeEntity.)
Public methodWriteTo(FormatOptions, String, Boolean, CancellationToken)
Write the MimeEntity to the specified file.
(Inherited from MimeEntity.)
Public methodWriteTo(FormatOptions, Stream, Boolean, CancellationToken)
Writes the Multipart to the specified output stream.
(Overrides MimeEntityWriteTo(FormatOptions, Stream, Boolean, CancellationToken).)
Public methodWriteToAsync(Stream, CancellationToken)
Asynchronously write the MimeEntity to the specified output stream.
(Inherited from MimeEntity.)
Public methodWriteToAsync(String, CancellationToken)
Asynchronously writes the MimeEntity to the specified file.
(Inherited from MimeEntity.)
Public methodWriteToAsync(Stream, Boolean, CancellationToken)
Adsynchronously write the MimeEntity to the specified output stream.
(Inherited from MimeEntity.)
Public methodWriteToAsync(String, Boolean, CancellationToken)
Asynchronously write the MimeEntity to the specified file.
(Inherited from MimeEntity.)
Public methodWriteToAsync(FormatOptions, Stream, CancellationToken)
Asynchronously write the MimeEntity to the specified output stream.
(Inherited from MimeEntity.)
Public methodWriteToAsync(FormatOptions, String, CancellationToken)
Asynchronously write the MimeEntity to the specified file.
(Inherited from MimeEntity.)
Public methodWriteToAsync(FormatOptions, String, Boolean, CancellationToken)
Asynchronously write the MimeEntity to the specified file.
(Inherited from MimeEntity.)
Public methodWriteToAsync(FormatOptions, Stream, Boolean, CancellationToken)
Asynchronously writes the Multipart to the specified output stream.
(Overrides MimeEntityWriteToAsync(FormatOptions, Stream, Boolean, CancellationToken).)
Top
Remarks

All multipart MIME entities will have a Content-Type with a media type of "multipart". The most common multipart MIME entity used in email is the "multipart/mixed" entity.

Four (4) initial subtypes were defined in the original MIME specifications: mixed, alternative, digest, and parallel.

The "multipart/mixed" type is a sort of general-purpose container. When used in email, the first entity is typically the "body" of the message while additional entities are most often file attachments.

Speaking of message "bodies", the "multipart/alternative" type is used to offer a list of alternative formats for the main body of the message (usually they will be "text/plain" and "text/html"). These alternatives are in order of increasing faithfulness to the original document (in other words, the last entity will be in a format that, when rendered, will most closely match what the sending client's WYSISYG editor produced).

The "multipart/digest" type will typically contain a digest of MIME messages and is most commonly used by mailing-list software.

The "multipart/parallel" type contains entities that are all meant to be shown (or heard) in parallel.

Another commonly used type is the "multipart/related" type which contains, as one might expect, inter-related MIME parts which typically reference each other via URIs based on the Content-Id and/or Content-Location headers.

See Also