API reference for aspose-email-foss 26.3 (Python 3.10+, MIT license).
All classes reside under aspose.email_foss. The primary import is:
Python naming convention: All methods use standard Python snake_case. For example, use msg.from_file() not msg.FromFile(), and msg.body_html() not msg.BodyHtml. Properties are accessed via getter/setter methods: msg.subject() reads the subject; msg.subject("new") sets it.
Message API
| Class | Description |
|---|
MapiMessage | High-level representation of an Outlook MSG message. Load with from_file(), create with create(), save with save(). Provides access to subject, body, HTML body, message class, recipients, and attachments. |
MapiAttachment | Represents a single attachment on a MapiMessage. Created via msg.add_attachment() or msg.add_embedded_message_attachment(). Query with storage_name(), is_embedded_message(). |
MapiRecipient | Represents a message recipient. Created via msg.add_recipient(). Supports To, CC, and BCC recipient types. |
MapiProperty | A single MAPI property entry. Access via msg.get_property() or msg.set_property(). Carries a property tag. |
MapiPropertyCollection | Collection of MAPI properties. Supports set(), get(), remove(), and iter_properties(). |
MapiNamedProperty | Defines a named MAPI property by string name or numeric LID within a property set. |
Property Enumerations
| Enumeration | Description |
|---|
CommonMessagePropertyId | Standard MAPI property IDs: SUBJECT, BODY, BODY_HTML, DISPLAY_TO, DISPLAY_CC, DISPLAY_BCC, SENDER_NAME, SENDER_EMAIL_ADDRESS, MESSAGE_DELIVERY_TIME, MESSAGE_FLAGS, and more. |
PropertyId | Extended property ID enumeration covering attachment and scheduling properties. |
PropertyTypeCode | MAPI property type codes: PTYP_STRING, PTYP_INTEGER32, PTYP_BINARY, PTYP_BOOLEAN, PTYP_TIME, and others. |
MSG Format
| Class | Description |
|---|
MsgDocument | Document-level representation of an MSG file structure. Created from MsgReader or built from a MapiMessage via to_msg_document(). |
MsgReader | Low-level MSG file reader. Opens from file path with from_file(). Provides access to property streams, recipient storages, and attachment storages. |
MsgWriter | Serializes an MsgDocument to bytes or a file with to_bytes() and write_file(). |
MsgStorage | Storage node within an MSG document tree. Holds streams and child storages. |
MsgStream | Data stream within an MSG storage. |
StorageLayout | Describes the storage structure of a parsed MSG file. |
CFB Format (Compound File Binary)
| Class | Description |
|---|
CFBReader | Low-level reader for CFB containers. Open with from_file(). Provides sector info, directory entries, and stream data access. |
CFBWriter | Serializes a CFBDocument to bytes or file. |
CFBDocument | In-memory CFB document structure. Built from a CFBReader or constructed programmatically. |
CFBStorage | Storage node in a CFB container. |
CFBStream | Stream node in a CFB container. |
DirectoryEntry | A single directory entry in the CFB structure. Query with is_storage(), is_stream(), is_root(). |
Enumerations
| Enumeration | Description |
|---|
DirectoryObjectType | CFB directory entry type: STORAGE_OBJECT, STREAM_OBJECT, ROOT_STORAGE_OBJECT. |
DirectoryColorFlag | Red-black tree color: RED, BLACK. |
SectorMarker | CFB sector markers: DIFSECT, FATSECT, ENDOFCHAIN, FREESECT. |
Exceptions
| Class | Description |
|---|
CFBError | Raised when a CFB container is invalid or corrupted. |
MsgError | Raised when an MSG structure is invalid. |
See Also