MapiMessage
Przegląd
MapiMessage jest klasą w Aspose.Email FOSS dla Python.
Mutowalny wysokopoziomowy obiekt MSG z obsługą konwersji MSG i EmailMessage.
Ta klasa udostępnia 22 metody do pracy z obiektami MapiMessage w programach Python. Dostępne metody obejmują: 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 oraz 10 dodatkowych metod. Wszystkie publiczne członki są dostępne dla każdej aplikacji Python po zainstalowaniu pakietu Aspose.Email FOSS dla Python. Właściwości: attachments, body, body_html, declared_attachment_count, declared_next_attachment_id, declared_next_recipient_id oraz 19 kolejnych.
Właściwości
| Nazwa | Typ | Dostęp | Opis |
|---|---|---|---|
msg_reader | MsgReader | Odczyt | Pobiera czytnik wiadomości. |
validation_issues | tuple[str, ...] | Odczyt | Zwraca problemy walidacji. |
subject | `str | None` | Odczyt/zapis |
body | `str | None` | Odczyt/zapis |
message_class | `str | None` | Odczyt/zapis |
body_html | `str | None` | Odczyt/zapis |
unicode_strings | bool | Odczyt/zapis | Pobiera lub ustawia ciągi Unicode. |
properties | MapiPropertyCollection | Odczyt/zapis | Pobiera lub ustawia właściwości. |
recipients | list[MapiRecipient] | Odczyt/zapis | Pobiera lub ustawia odbiorców. |
attachments | list[MapiAttachment] | Odczyt/zapis | Pobiera lub ustawia załączniki. |
extra_streams | list[MsgStream] | Odczyt/zapis | Pobiera lub ustawia dodatkowe strumienie. |
extra_storages | list[MsgStorage] | Odczyt/zapis | Pobiera lub ustawia dodatkowe magazyny. |
nameid_mapping | _NamedPropertyMapping | Odczyt/zapis | Pobiera lub ustawia mapowanie nameid. |
major_version | int | Odczyt/zapis | Pobiera lub ustawia główną wersję. |
minor_version | int | Odczyt/zapis | Pobiera lub ustawia wersję pomocniczą. |
transaction_signature_number | int | Odczyt/zapis | Pobiera lub ustawia numer sygnatury transakcji. |
header_reserved_0 | bytes | Odczyt/zapis | Pobiera lub ustawia nagłówek rezerwowany 0. |
header_reserved_1 | bytes | Odczyt/zapis | Pobiera lub ustawia nagłówek zarezerwowany 1. |
emit_store_support_mask | bool | Odczyt/zapis | Pobiera lub ustawia maskę obsługi przechowywania emit. |
emit_compatibility_defaults | bool | Odczyt/zapis | Pobiera lub ustawia domyślne ustawienia zgodności emitowania. |
preserve_declared_header_counts | bool | Odczyt/zapis | Pobiera lub ustawia liczbę zachowanych zadeklarowanych nagłówków. |
declared_next_recipient_id | `int | None` | Odczyt/zapis |
declared_next_attachment_id | `int | None` | Odczyt/zapis |
declared_recipient_count | `int | None` | Odczyt/zapis |
declared_attachment_count | `int | None` | Odczyt/zapis |
Metody
| Sygnatura | Opis |
|---|---|
| `from_file(path: Path | str, strict: bool)→“MapiMessage”` |
from_msg_document(document: MsgDocument) → "MapiMessage" | Wywołuje from_msg_document(document) na tej instancji MapiMessage. |
from_email_message(email_message: EmailMessage, unicode_strings: bool) → "MapiMessage" | Wywołuje from_email_message(email_message, unicode_strings) na tej instancji MapiMessage. |
create(subject: str, body: str, unicode_strings: bool) → "MapiMessage" | Wywołuje create(subject, body, unicode_strings) na tej instancji MapiMessage. |
iter_properties() → Iterator[MapiProperty] | Wywołuje iter_properties na tej instancji MapiMessage. |
iter_property_keys(storage_stream_id: int) → Iterator[tuple[int, int]] | Wywołuje iter_property_keys(storage_stream_id) na tej instancji MapiMessage. |
| `set_property(property_id: int | CommonMessagePropertyId |
| `get_property(property_id: int | CommonMessagePropertyId |
| `get_property_value(property_id: int | CommonMessagePropertyId |
| `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 |
| `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 |
| `add_embedded_message_attachment(message: “MapiMessage”, filename: str | None, mime_type: str |
| `save(path: Path | str)` |
to_bytes() → bytes | Wywołuje to_bytes na tej instancji MapiMessage. |
to_email_message() → EmailMessage | Wywołuje to_email_message na tej instancji MapiMessage. |
to_email_bytes() → bytes | Wywołuje to_email_bytes na tej instancji MapiMessage. |
to_email_string() → str | Wywołuje to_email_string na tej instancji MapiMessage. |
iter_attachments_info() → Iterator[MapiAttachment] | Wywołuje iter_attachments_info na tej instancji MapiMessage. |
close() | Wywołuje close na tej instancji MapiMessage. |
to_msg_document() → MsgDocument | Wywołuje to_msg_document na tej instancji MapiMessage. |