Skip to main content

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.EmailMessage conversion

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 .msg files 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 model
  • aspose.email_foss.msg.MsgReader: low-level MSG reader
  • aspose.email_foss.msg.MsgWriter: low-level MSG writer
  • aspose.email_foss.cfb.CFBReader: low-level CFB reader
  • aspose.email_foss.cfb.CFBWriter: low-level CFB writer

Compatibility

Main supported scenarios:

  • Read Outlook .msg files
  • Write Outlook .msg files
  • Inspect Compound File Binary (CFB) containers
  • Convert .msg to .eml
  • Convert .eml to .msg
  • Work with recipients, attachments, and embedded messages

API layers:

  • High-level MSG API: aspose.email_foss.msg, centered around MapiMessage
  • Low-level MSG API: aspose.email_foss.msg, centered around MsgReader, MsgWriter, and MsgDocument
  • Low-level CFB API: aspose.email_foss.cfb, centered around CFBReader, CFBWriter, and CFBDocument

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

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)

Source distribution for aspose-email-foss 26.3
File Size Uploaded
aspose_email_foss-26.3.tar.gz 50.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aspose-email-foss 26.3
File Interpreter ABI Platform
aspose_email_foss-26.3-py3-none-any.whl Python 3 none any Details

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 log

Release 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 log

Release history Release notifications | RSS feed

This release

26.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page