MapiMessage

概述

MapiMessage 是 Aspose.Email FOSS 中用于 Python 的一个类。

可变的高级 MSG 对象,支持 MSG 和 EmailMessage 转换。

此类提供 22 个方法,用于在 Python 程序中处理 MapiMessage 对象。可用的方法包括: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,以及另外 10 个方法。安装 Aspose.Email FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性有:attachments、body、body_html、declared_attachment_count、declared_next_attachment_id、declared_next_recipient_id,以及另外 19 项。

属性

名称类型访问描述
msg_readerMsgReader读取获取 msg reader。
validation_issuestuple[str, ...]读取获取验证问题。
subject`strNone`读写
body`strNone`读写
message_class`strNone`读写
body_html`strNone`读写
unicode_stringsbool读写获取或设置 Unicode 字符串。
propertiesMapiPropertyCollection读写获取或设置属性。
recipientslist[MapiRecipient]读写获取或设置收件人。
attachmentslist[MapiAttachment]读写获取或设置附件。
extra_streamslist[MsgStream]读写获取或设置额外的流。
extra_storageslist[MsgStorage]读写获取或设置额外的存储。
nameid_mapping_NamedPropertyMapping读写获取或设置 nameid 映射。
major_versionint读写获取或设置主版本。
minor_versionint读写获取或设置次要版本。
transaction_signature_numberint读写获取或设置事务签名编号。
header_reserved_0bytes读写获取或设置标头保留 0。
header_reserved_1bytes读写获取或设置标头保留字段 1。
emit_store_support_maskbool读写获取或设置 emit store 支持掩码。
emit_compatibility_defaultsbool读写获取或设置发射兼容性默认值。
preserve_declared_header_countsbool读写获取或设置保留已声明的标头计数。
declared_next_recipient_id`intNone`读写
declared_next_attachment_id`intNone`读写
declared_recipient_count`intNone`读写
declared_attachment_count`intNone`读写

方法

签名描述
`from_file(path: Pathstr, strict: bool)→“MapiMessage”`
from_msg_document(document: MsgDocument) → "MapiMessage"在此 MapiMessage 实例上调用 from_msg_document(document)。
from_email_message(email_message: EmailMessage, unicode_strings: bool) → "MapiMessage"在此 MapiMessage 实例上调用 from_email_message(email_message, unicode_strings)。
create(subject: str, body: str, unicode_strings: bool) → "MapiMessage"在此 MapiMessage 实例上调用 create(subject, body, unicode_strings)。
iter_properties() → Iterator[MapiProperty]在此 MapiMessage 实例上调用 iter_properties。
iter_property_keys(storage_stream_id: int) → Iterator[tuple[int, int]]在此 MapiMessage 实例上调用 iter_property_keys(storage_stream_id)。
`set_property(property_id: intCommonMessagePropertyId
`get_property(property_id: intCommonMessagePropertyId
`get_property_value(property_id: intCommonMessagePropertyId
`set_named_property(named_property: MapiNamedProperty, property_type: intPropertyTypeCode, value: Any, flags: int)→MapiProperty`
`get_named_property(named_property: MapiNamedProperty, property_type: intNone)→MapiProperty
`add_recipient(email_address: str, display_name: strNone, recipient_type: int)→MapiRecipient`
`add_attachment(filename: str, data: bytes, mime_type: strNone, content_id: str
`add_embedded_message_attachment(message: “MapiMessage”, filename: strNone, mime_type: str
`save(path: Pathstr)`
to_bytes() → bytes在此 MapiMessage 实例上调用 to_bytes。
to_email_message() → EmailMessage在此 MapiMessage 实例上调用 to_email_message。
to_email_bytes() → bytes在此 MapiMessage 实例上调用 to_email_bytes。
to_email_string() → str在此 MapiMessage 实例上调用 to_email_string。
iter_attachments_info() → Iterator[MapiAttachment]在此 MapiMessage 实例上调用 iter_attachments_info。
close()在此 MapiMessage 实例上调用 close。
to_msg_document() → MsgDocument在此 MapiMessage 实例上调用 to_msg_document。

另请参阅

 中文