MapiAttachment

Overview

MapiAttachment is a class in Aspose.Email FOSS for Python.

Mutable attachment object.

Properties

NameTypeAccessDescription
storage_namestr | NoneReadIs the name of the storage where the attachment resides, or None
is_embedded_messageboolReadIndicates whether the attachment is an embedded message
is_storage_attachmentboolReadIndicates the attachment is stored as a separate storage
embedded_storage_namestr | NoneReadHolds the storage name for an embedded message attachment, or None
filenamestr | NoneReadIs the file name of the attachment, or None
databytesReadContains the raw byte content of the attachment
mime_typestr | NoneReadIs the MIME type of the attachment, or None
content_idstr | NoneReadIs the content identifier used for inline attachments, or None
attach_methodintReadIs the integer code representing how the attachment is attached
storage_idint | NoneReadIs the identifier of the storage containing the attachment, or None
embedded_message"MapiMessage | None"ReadIs the MapiMessage object if the attachment is an embedded message, else None
custom_storageMsgStorage | NoneReadReferences a custom MsgStorage for the attachment, or None
propertiesMapiPropertyCollectionReadIs a collection of MapiProperty objects associated with the attachment
extra_streamslist[MsgStream]ReadIs a list of additional MsgStream objects attached to the attachment
header_reserved_0bytesReadContains reserved header bytes for the attachment

Methods

SignatureDescription
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)MapiPropertyAdds or updates a property identified by ID with type/value and flags, returning a MapiProperty

See Also