Mime Model
MailMessage is wrapped around a more complex model. That model is a tree-structured model, which conforms to the Multipurpose Internet Mail Extensions (MIME) standard. The following image provides an overview of the MIME model and how it references the main model.
All the MIME relevant classes can be found in a GemBox.Email.Mime namespace.
Entities
MailMessage and Attachment expose the underlying MIME models through the MailMessage.MimeEntity and Attachment.MimeEntity properties. The properties return an instance that inherits from the Entity base class. There are only two classes that derive from this base class:
- ContentEntity - A simple entity class that cannot have children and holds content like: text or HTML message body, or attachment data.
- MultipartEntity - A collection entity that can contain other entities as its children, but cannot hold data. It is used as a root entity for messages with multiple body versions and/or attachments.
Headers
Each MIME entity has a collection of Header items, which can be accessed through the Headers property. Headers hold data that describes the parent entity and its purpose along with some additional information. The GemBox.Email component will automatically add mandatory headers to a message root entity.