MapiAttachment

Overview

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

Mutable attachment object.

This class provides 3 methods for working with MapiAttachment objects in Python programs. Available methods include: from_bytes, from_embedded_message, set_property. All public members are accessible to any Python application after installing the Aspose.Email FOSS for Python package. Properties: attach_method, content_id, custom_storage, data, embedded_message, embedded_storage_name, and 9 more.

Properties

NameTypeAccessDescription
storage_namestr | NoneReadGets the storage name.
is_embedded_messageboolReadGets the is embedded message.
is_storage_attachmentboolReadGets the is storage attachment.
embedded_storage_namestr | NoneReadGets the embedded storage name.
filenamestr | NoneRead/WriteGets or sets the filename.
databytesRead/WriteGets or sets the data.
mime_typestr | NoneRead/WriteGets or sets the mime type.
content_idstr | NoneRead/WriteGets or sets the content id.
attach_methodintRead/WriteGets or sets the attach method.
storage_idint | NoneRead/WriteGets or sets the storage id.
embedded_message"MapiMessage | None"Read/WriteGets or sets the embedded message.
custom_storageMsgStorage | NoneRead/WriteGets or sets the custom storage.
propertiesMapiPropertyCollectionRead/WriteGets or sets the properties.
extra_streamslist[MsgStream]Read/WriteGets or sets the extra streams.
header_reserved_0bytesRead/WriteGets or sets the header reserved 0.

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)MapiPropertySets the property value.

See Also