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

Metadata

Release files for envelope 2.4.1

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.1
File Size Uploaded
envelope-2.4.1.tar.gz 42.9 kB Details

Built distribution (wheel)

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

Total release size: 89.6 kB

Release files / envelope-2.4.1.tar.gz

Download URL envelope-2.4.1.tar.gz
Size 42.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3bb20ffcee9aeb5f2b94d7aac3b72c8af8b80265a95666242d3eee487a43d6dc
BLAKE2b-256 checksum
How to use checksums
eca84c7cbac0f0a5a9da7915d48a615b822115fa42bb0b0aa21c6bec1316fbe8
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.1-py3-none-any.whl

Download URL envelope-2.4.1-py3-none-any.whl
Size 46.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a6e83dbd85ee44993b0a1e9d954a43c8b6e5f8cfbe54eb2cd2bb8083e8fef8c
BLAKE2b-256 checksum
How to use checksums
eb3fc5c6b3d4625810f94d8686ed5bd0c87cf7b1e192e4e1c6d1a6dc067f95cf
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.1 This release

2 release files

2.4.0

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