Aspose.Email FOSS for Python
Aspose.Email FOSS for Python is a pure Python toolkit for working with:
- Compound File Binary (CFB) containers
- Outlook MSG files
- High-level MAPI-style message objects
email.message.EmailMessageconversion
It is focused on practical MSG read/write workflows in a lightweight open-source package.
Features
- Read CFB and Outlook MSG containers
- Inspect low-level storages, streams, and property bags
- Read, edit, and write messages through
MapiMessage - Work with recipients, attachments, and embedded messages
- Convert between MSG and
email.message.EmailMessage - Create new Outlook-compatible
.msgfiles in pure Python
Installation
pip install aspose-email-foss
Quick Start
from datetime import datetime, timezone
from aspose.email_foss import msg
message = msg.MapiMessage.create("Hello", "Body")
message.set_property(msg.PropertyId.SENDER_NAME, "Build Agent")
message.set_property(msg.PropertyId.SENDER_EMAIL_ADDRESS, "build.agent@example.com")
message.set_property(msg.PropertyId.MESSAGE_DELIVERY_TIME, datetime(2026, 3, 15, 10, 30, tzinfo=timezone.utc))
message.add_recipient("alice@example.com", display_name="Alice Example")
message.add_attachment("hello.txt", b"sample attachment\n", mime_type="text/plain")
message.save("example-message.msg")
with msg.MapiMessage.from_file("example-message.msg") as loaded:
email_message = loaded.to_email_message()
print(email_message["Subject"])
Package Entry Points
aspose.email_foss.msg.MapiMessage: high-level mutable MSG modelaspose.email_foss.msg.MsgReader: low-level MSG readeraspose.email_foss.msg.MsgWriter: low-level MSG writeraspose.email_foss.cfb.CFBReader: low-level CFB readeraspose.email_foss.cfb.CFBWriter: low-level CFB writer
Compatibility
Main supported scenarios:
- Read Outlook
.msgfiles - Write Outlook
.msgfiles - Inspect Compound File Binary (CFB) containers
- Convert
.msgto.eml - Convert
.emlto.msg - Work with recipients, attachments, and embedded messages
API layers:
- High-level MSG API:
aspose.email_foss.msg, centered aroundMapiMessage - Low-level MSG API:
aspose.email_foss.msg, centered aroundMsgReader,MsgWriter, andMsgDocument - Low-level CFB API:
aspose.email_foss.cfb, centered aroundCFBReader,CFBWriter, andCFBDocument
email.message.EmailMessage interop:
MapiMessage.from_email_message(...)MapiMessage.to_email_message()
Outlook-oriented behavior:
- standard message creation
- recipients
- file attachments
- embedded message attachments
- common message property defaults for practical Outlook interoperability
For the stable API summary, see PUBLIC_API.md. For runnable scenarios, see examples.
Examples
Convert MSG to EML
from aspose.email_foss import msg
with msg.MapiMessage.from_file("message.msg") as message:
email_message = message.to_email_message()
with open("message.eml", "wb") as target:
target.write(email_message.as_bytes())
Convert EML to MSG
from email import policy
from email.parser import BytesParser
from aspose.email_foss import msg
with open("message.eml", "rb") as source:
email_message = BytesParser(policy=policy.default).parse(source)
message = msg.MapiMessage.from_email_message(email_message)
message.save("message.msg")
Useful Links
- Repository: https://github.com/aspose-email-foss/Aspose.Email-FOSS-for-Python
- Aspose.Email for Python product page: https://products.aspose.com/email/python-net/
- Aspose.Email for Python documentation: https://docs.aspose.com/email/python-net/
- Aspose.Email support forum: https://forum.aspose.com/c/email/9
Development
See CONTRIBUTING.md.
Security
See SECURITY.md.
Changelog
See CHANGELOG.md.
Metadata
Release files for aspose-email-foss 26.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aspose_email_foss-26.3.tar.gz | 50.8 kB | With provenance | Details for aspose_email_foss-26.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aspose_email_foss-26.3-py3-none-any.whl | Python 3 | none | any | Details for aspose_email_foss-26.3-py3-none-any.whl |
Total release size: 96.1 kB
Release files / aspose_email_foss-26.3.tar.gz
| Download URL | aspose_email_foss-26.3.tar.gz |
|---|---|
| Size | 50.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2e5b8be13671c169f7309c67ce0d54d521b4c660c6e0e8286cdf75217fbaa74
|
|
BLAKE2b-256 checksum How to use checksums |
1a69489bf60a973a0a8c5d9ec59b5a1441a50d00fcf050850f3a046dc69cdb5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 16, 2026.
Transparency logRelease files / aspose_email_foss-26.3-py3-none-any.whl
| Download URL | aspose_email_foss-26.3-py3-none-any.whl |
|---|---|
| Size | 45.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6552466727acacf9decea4cfa2e913133c92f8619d7a1674b715d7216b6b545
|
|
BLAKE2b-256 checksum How to use checksums |
81087119d5a962385d6b0b842cfaa278f06b9b425bc58a6d375317307cec1ea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 16, 2026.
Transparency logSecurity for aspose-email-foss 26.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for aspose_email_foss-26.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.