MapiRecipient

Overview

MapiRecipient represents one addressee on a MapiMessage. Instances are returned by MapiMessage.add_recipient(). The recipient type determines whether the address appears in the TO, CC, or BCC fields. Recipient type constants RECIPIENT_TYPE_TO = 1, RECIPIENT_TYPE_CC = 2, and RECIPIENT_TYPE_BCC = 3 are available directly in the aspose.email_foss.msg module. Individual MAPI properties on the recipient can be read or set through the properties collection or via set_property().

from aspose.email_foss import msg

message = msg.MapiMessage.create("Meeting", "See you there.")
message.add_recipient("alice@example.com", display_name="Alice")
message.add_recipient("bob@example.com", display_name="Bob", recipient_type=msg.RECIPIENT_TYPE_CC)
message.save("meeting.msg")

Key Fields

NameTypeDescription
display_namestr | NoneHuman-readable display name.
email_addressstr | NoneSMTP email address.
recipient_typeint1 = TO, 2 = CC, 3 = BCC.
address_typestrAddress type string (e.g. SMTP).
propertiesMapiPropertyCollectionFull MAPI property bag for this recipient.

Methods

SignatureDescription
set_property(property_id, property_type_or_value, value=..., flags=...) -> MapiPropertySet or replace a MAPI property on this recipient.

See Also