MapiAttachment
Overview
MapiAttachment is a class in Aspose.Email FOSS for Python.
Mutable attachment object.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
storage_name | str | None | Read | Is the name of the storage where the attachment resides, or None |
is_embedded_message | bool | Read | Indicates whether the attachment is an embedded message |
is_storage_attachment | bool | Read | Indicates the attachment is stored as a separate storage |
embedded_storage_name | str | None | Read | Holds the storage name for an embedded message attachment, or None |
filename | str | None | Read | Is the file name of the attachment, or None |
data | bytes | Read | Contains the raw byte content of the attachment |
mime_type | str | None | Read | Is the MIME type of the attachment, or None |
content_id | str | None | Read | Is the content identifier used for inline attachments, or None |
attach_method | int | Read | Is the integer code representing how the attachment is attached |
storage_id | int | None | Read | Is the identifier of the storage containing the attachment, or None |
embedded_message | "MapiMessage | None" | Read | Is the MapiMessage object if the attachment is an embedded message, else None |
custom_storage | MsgStorage | None | Read | References a custom MsgStorage for the attachment, or None |
properties | MapiPropertyCollection | Read | Is a collection of MapiProperty objects associated with the attachment |
extra_streams | list[MsgStream] | Read | Is a list of additional MsgStream objects attached to the attachment |
header_reserved_0 | bytes | Read | Contains reserved header bytes for the attachment |
Methods
| Signature | Description |
|---|---|
from_bytes(filename: str, data: bytes, mime_type: str | None, content_id: str | None) → "MapiAttachment" | Creates a MapiAttachment from a filename, raw data, optional MIME type and content ID |
from_embedded_message(message: "MapiMessage", filename: str | None, mime_type: str | None) → "MapiAttachment" | Creates a MapiAttachment that wraps a MapiMessage as an embedded message |
set_property(property_id: int | CommonMessagePropertyId | PropertyId, property_type_or_value: int | PropertyTypeCode | Any, value: Any, flags: int) → MapiProperty | Adds or updates a property identified by ID with type/value and flags, returning a MapiProperty |