MapiAttachment
Overview
MapiAttachment is a class in Aspose.Email FOSS for .NET.
MapiAttachment.FromBytes creates an attachment from a filename, byte array, optional MIME type and content ID.
Description
MapiAttachment is a class in the Aspose.Email FOSS library for .NET that exposes 4 methods and 8 properties for programmatic use.
The class also provides the Properties property (provides the collection of mapi properties associated with the attachment), the IsEmbeddedMessage property (indicates whether the attachment contains an embedded message), the IsStorageAttachment property (indicates whether the attachment is a storage (ole) attachment).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Filename | string? | Read/Write | Gets or sets the attachment’s file name |
Data | byte[] | Read/Write | Gets or sets the raw byte content of the attachment |
MimeType | string? | Read/Write | Gets or sets the MIME type of the attachment |
ContentId | string? | Read/Write | Gets or sets the content identifier for inline attachments |
EmbeddedMessage | MapiMessage? | Read/Write | Gets or sets an embedded MapiMessage if the attachment is a message |
Properties | MapiPropertyCollection | Read | Provides the collection of MAPI properties associated with the attachment |
IsEmbeddedMessage | bool | Read | Indicates whether the attachment contains an embedded message |
IsStorageAttachment | bool | Read | Indicates whether the attachment is a storage (OLE) attachment |
Methods
| Signature | Description |
|---|---|
FromBytes(filename: string, data: byte[], mimeType: string?, contentId: string?) | Creates an attachment from a filename, byte array, optional MIME type and content ID |
FromStream(filename: string, stream: Stream, mimeType: string?, contentId: string?) | |
LoadData(stream: Stream) | Loads attachment binary data from the given stream into the attachment |
OpenRead() | Returns a readable stream for the attachment’s data |