MapiMessage

Overview

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

Mutable high-level MSG object with MSG and EmailMessage conversion support.

This class provides 22 methods for working with MapiMessage objects in Python programs. Available methods include: add_attachment, add_embedded_message_attachment, add_recipient, close, create, from_email_message, from_file, from_msg_document, get_named_property, get_property, get_property_value, iter_attachments_info, and 10 additional methods. All public members are accessible to any Python application after installing the Aspose.Email FOSS for Python package. Properties: attachments, body, body_html, declared_attachment_count, declared_next_attachment_id, declared_next_recipient_id, and 19 more.

Properties

NameTypeAccessDescription
msg_readerMsgReaderReadGets the msg reader.
validation_issuestuple[str, ...]ReadGets the validation issues.
subjectstr | NoneRead/WriteGets or sets the subject.
bodystr | NoneRead/WriteGets or sets the body.
message_classstr | NoneRead/WriteGets or sets the message class.
body_htmlstr | NoneRead/WriteGets or sets the body html.
unicode_stringsboolRead/WriteGets or sets the unicode strings.
propertiesMapiPropertyCollectionRead/WriteGets or sets the properties.
recipientslist[MapiRecipient]Read/WriteGets or sets the recipients.
attachmentslist[MapiAttachment]Read/WriteGets or sets the attachments.
extra_streamslist[MsgStream]Read/WriteGets or sets the extra streams.
extra_storageslist[MsgStorage]Read/WriteGets or sets the extra storages.
nameid_mapping_NamedPropertyMappingRead/WriteGets or sets the nameid mapping.
major_versionintRead/WriteGets or sets the major version.
minor_versionintRead/WriteGets or sets the minor version.
transaction_signature_numberintRead/WriteGets or sets the transaction signature number.
header_reserved_0bytesRead/WriteGets or sets the header reserved 0.
header_reserved_1bytesRead/WriteGets or sets the header reserved 1.
emit_store_support_maskboolRead/WriteGets or sets the emit store support mask.
emit_compatibility_defaultsboolRead/WriteGets or sets the emit compatibility defaults.
preserve_declared_header_countsboolRead/WriteGets or sets the preserve declared header counts.
declared_next_recipient_idint | NoneRead/WriteGets or sets the declared next recipient id.
declared_next_attachment_idint | NoneRead/WriteGets or sets the declared next attachment id.
declared_recipient_countint | NoneRead/WriteGets or sets the declared recipient count.
declared_attachment_countint | NoneRead/WriteGets or sets the declared attachment count.

Methods

SignatureDescription
from_file(path: Path | str, strict: bool)"MapiMessage"Calls from_file on this MapiMessage instance.
from_msg_document(document: MsgDocument)"MapiMessage"Calls from_msg_document on this MapiMessage instance.
from_email_message(email_message: EmailMessage, unicode_strings: bool)"MapiMessage"Calls from_email_message on this MapiMessage instance.
create(subject: str, body: str, unicode_strings: bool)"MapiMessage"Calls create on this MapiMessage instance.
iter_properties()Iterator[MapiProperty]Calls iter_properties on this MapiMessage instance.
iter_property_keys(storage_stream_id: int)Iterator[tuple[int, int]]Calls iter_property_keys on this MapiMessage instance.
set_property(property_id: int | CommonMessagePropertyId | PropertyId, property_type_or_value: int | PropertyTypeCode | Any, value: Any, flags: int)MapiPropertySets the property value.
get_property(property_id: int | CommonMessagePropertyId | PropertyId, property_type: int | None, storage_stream_id: int | None, decode: bool | None)MapiProperty | Any | NoneCalls get_property on this MapiMessage instance.
get_property_value(property_id: int | CommonMessagePropertyId | PropertyId, property_type: int | None, storage_stream_id: int, decode: bool)Any | NoneCalls get_property_value on this MapiMessage instance.
set_named_property(named_property: MapiNamedProperty, property_type: int | PropertyTypeCode, value: Any, flags: int)MapiPropertySets the named property value.
get_named_property(named_property: MapiNamedProperty, property_type: int | None)MapiProperty | NoneCalls get_named_property on this MapiMessage instance.
add_recipient(email_address: str, display_name: str | None, recipient_type: int)MapiRecipientCalls add_recipient on this MapiMessage instance.
add_attachment(filename: str, data: bytes, mime_type: str | None, content_id: str | None)MapiAttachmentCalls add_attachment on this MapiMessage instance.
add_embedded_message_attachment(message: "MapiMessage", filename: str | None, mime_type: str | None)MapiAttachmentCalls add_embedded_message_attachment on this MapiMessage instance.
save(path: Path | str)Calls save on this MapiMessage instance.
to_bytes()bytesCalls to_bytes on this MapiMessage instance.
to_email_message()EmailMessageCalls to_email_message on this MapiMessage instance.
to_email_bytes()bytesCalls to_email_bytes on this MapiMessage instance.
to_email_string()strCalls to_email_string on this MapiMessage instance.
iter_attachments_info()Iterator[MapiAttachment]Calls iter_attachments_info on this MapiMessage instance.
close()Calls close on this MapiMessage instance.
to_msg_document()MsgDocumentCalls to_msg_document on this MapiMessage instance.

See Also