MapiMessage
Overview
MapiMessage is a class in Aspose.Email FOSS for Python.
Mutable high-level MSG object with MSG and EmailMessage conversion support.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
msg_reader | MsgReader | Read | |
validation_issues | tuple[str, ...] | Read | |
subject | str | None | Read | |
body | str | None | Read | |
message_class | str | None | Read | |
body_html | str | None | Read | |
unicode_strings | bool | Read | |
properties | MapiPropertyCollection | Read | |
recipients | list[MapiRecipient] | Read | |
attachments | list[MapiAttachment] | Read | |
extra_streams | list[MsgStream] | Read | |
extra_storages | list[MsgStorage] | Read | |
nameid_mapping | _NamedPropertyMapping | Read | |
major_version | int | Read | |
minor_version | int | Read | |
transaction_signature_number | int | Read | |
header_reserved_0 | bytes | Read | |
header_reserved_1 | bytes | Read | |
emit_store_support_mask | bool | Read | |
emit_compatibility_defaults | bool | Read | |
preserve_declared_header_counts | bool | Read | |
declared_next_recipient_id | int | None | Read | |
declared_next_attachment_id | int | None | Read | |
declared_recipient_count | int | None | Read | |
declared_attachment_count | int | None | Read |
Methods
| Signature | Description |
|---|---|
from_file(path: Path | str, strict: bool) → "MapiMessage" | |
from_msg_document(document: MsgDocument) → "MapiMessage" | |
from_email_message(email_message: EmailMessage, unicode_strings: bool) → "MapiMessage" | |
create(subject: str, body: str, unicode_strings: bool) → "MapiMessage" | |
iter_properties() → Iterator[MapiProperty] | |
iter_property_keys(storage_stream_id: int) → Iterator[tuple[int, int]] | |
set_property(property_id: int | CommonMessagePropertyId | PropertyId, property_type_or_value: int | PropertyTypeCode | Any, value: Any, flags: int) → MapiProperty | |
get_property(property_id: int | CommonMessagePropertyId | PropertyId, property_type: int | None, storage_stream_id: int | None, decode: bool | None) → MapiProperty | Any | None | |
get_property_value(property_id: int | CommonMessagePropertyId | PropertyId, property_type: int | None, storage_stream_id: int, decode: bool) → Any | None | |
set_named_property(named_property: MapiNamedProperty, property_type: int | PropertyTypeCode, value: Any, flags: int) → MapiProperty | |
get_named_property(named_property: MapiNamedProperty, property_type: int | None) → MapiProperty | None | |
add_recipient(email_address: str, display_name: str | None, recipient_type: int) → MapiRecipient | |
add_attachment(filename: str, data: bytes, mime_type: str | None, content_id: str | None) → MapiAttachment | |
add_embedded_message_attachment(message: "MapiMessage", filename: str | None, mime_type: str | None) → MapiAttachment | |
save(path: Path | str) | |
to_bytes() → bytes | |
to_email_message() → EmailMessage | |
to_email_bytes() → bytes | |
to_email_string() → str | |
iter_attachments_info() → Iterator[MapiAttachment] | |
close() | |
to_msg_document() → MsgDocument |