Skip to main content

Envelope

Build Status Downloads

A thin, fluent layer over python-gnupg, cryptography, M2Crypto, smtplib, magic and email — their common use cases merged into a single object. Tired of forgetting how to sign a message correctly? You do not need to know everything about GPG or S/MIME, you do not have to bother with importing keys, you do not have to hassle with reconnecting to an SMTP server, and you do not have to study what every header means just to let your users unsubscribe via a URL. You insert a message, attachments and inline images and get back signed and/or encrypted output — written to a file or sent straight to your recipients' e-mail. Just a single line of code, as the examples below show.

Envelope("my message")
    .subject("hello world")
    .to("example@example.com")
    .attach(file_contents, name="attached-file.txt")
    .smtp("localhost", 587, "user", "pass", "starttls")
    .signature()
    .send()
# Inline image
Envelope("My inline image: <img src='cid:image.jpg' />")
    .attach(path="image.jpg", inline=True)

# Load a message and read its attachments
Envelope.load(path="message.eml").attachments()
# in bash: envelope --load message.eml --attachments

Documentation

  • Installation — PyPI/GitHub install, GPG/S-MIME prerequisites, bash completion.
  • Usage — the CLI, the fluent interface and the one-liner module call.
  • Reference — every setter, in all three interfaces:
    • Overview — notation used below, "any attainable contents".
    • Input / Output — message, output.
    • Recipients — from, to, cc, bcc, reply-to, from_addr.
    • Sending — send, subject, date, smtp, attachments, mime, headers.
    • Ciphering — choosing GPG/S-MIME, signing, encrypting.
    • Supportive — recipients(), copy(), preview, check, load, Address.
    • Experimental — _report(), _check_auth().
    • Envelope object — converting to str/bool, object equality.
  • Examples — signing/encrypting, sending, attachments, inline images, a complex example.
  • Related affairs — configuring an SMTP server, GPG, S/MIME, and SPF/DKIM/DMARC.
  • Changelog

Release files for envelope 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envelope 2.4.0
File Size Uploaded
envelope-2.4.0.tar.gz 42.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for envelope 2.4.0
File Interpreter ABI Platform
envelope-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 88.0 kB

Release files / envelope-2.4.0.tar.gz

Download URL envelope-2.4.0.tar.gz
Size 42.0 kB
Tags Source
SHA-256 checksum
How to use checksums
55ad855f3ab31f659c4a978692ddd202fee3b3775bb8e07f0a5d50b0d484e4c1
BLAKE2b-256 checksum
How to use checksums
46fe7c3b2a7377cb3741563fa4b891b9bc788578f4986f5426a28b2292f19116
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / envelope-2.4.0-py3-none-any.whl

Download URL envelope-2.4.0-py3-none-any.whl
Size 46.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e48d1aeb79496bf91bf02c94fa341680c253f411bdee26d07f085a53142abc7f
BLAKE2b-256 checksum
How to use checksums
a33b713ac1ad3f9de208227b1183c3cd96390a032328e3f5d218ed66a7934ec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.5

1 release file

2.0.4

1 release file

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

1 release file

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5

1 release file

1.4.1

1 release file

1.4

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1 release file

1.2.7

1 release file

1.2.6

1 release file

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2

1 release file

1.1

1 release file

1.0.0

1 release file

0.9.9

1 release file

0.9.8

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

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