emails
Modern python library for emails.
What it is and what it does
python-emails is a high-level library for composing and sending emails in Python, sitting above the standard library's email and smtplib modules. It handles HTML and plain-text messages in a single object, manages attachments and inline images, supports template rendering, applies HTML transformations like CSS inlining, signs messages with DKIM, and sends via SMTP with TLS/SSL—all without requiring manual MIME tree construction.
The library is designed for developers who need more than basic plain-text SMTP but want to avoid boilerplate. It depends on python-dateutil for date handling, puremagic for file type detection, and dkimpy for cryptographic signing. The package is production-stable, actively maintained, and supports Python 3.10 through 3.14.
Use it for:
- Send transactional emails (receipts, confirmations) with HTML formatting and PDF attachments
- Render templated emails using Jinja2 or Mako with dynamic content and CSS inlining
- Build marketing or notification emails with inline images and HTML transformations
- Sign outgoing emails with DKIM for improved deliverability and authentication
- Load and transform email messages from external sources (URLs, files, ZIP archives)
- Integrate email sending into Django applications via the DjangoMessage class
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Build and send HTML and plain-text emails with attachments, inline images, template rendering, and DKIM signing through a high-level Python API.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. Install it if you need to send HTML emails, attach files, render templates, or sign with DKIM—features that would otherwise require substantial boilerplate. Skip it only if you need only minimal plain-text SMTP and want to avoid any dependencies.
Install
emails on PyPI
pip
pip install emailsuv
uv add emailspoetry
poetry add emailsInstalling emails
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent release 88 days ago and ongoing commits. Depends on python-dateutil, puremagic, and dkimpy—all stable, widely-used libraries.
License in practice
Apache 2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most projects.
Quickstart
pip install emails
import emails
message = emails.html(
subject="Test",
html="<p>Hello</p>",
mail_from=("sender", "sender@example.com")
)
response = message.send(
to="recipient@example.com",
smtp={"host": "smtp.example.com", "port": 587, "tls": True}
)
Requires Python 3.10 or later. SMTP credentials and a working mail server are needed to send messages.
Verify before relying
- Whether optional extras (html, jinja, async) are automatically installed or require explicit specification
- Performance characteristics when handling large attachments or bulk message composition
- Compatibility details with async/await patterns beyond the aiosmtplib integration mentioned
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — python-dateutil, puremagic, dkimpy |
| Maintenance | actively maintained — 88 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 796,004/month — #5,033 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: emails-1.1.2-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
email-toWraps Python's standard email modules to…
permissive · top 15,000 on PyPI
yagmailSimplifies sending emails via Gmail or any SMTP…
permissive · top 15,000 on PyPI
redmailRedmail simplifies sending emails with Python…
permissive · top 15,000 on PyPI
mailslurp-clientMailSlurp provides a Python client for an email…
unclear · top 15,000 on PyPI
fastapi-mailSends emails and attachments asynchronously…
permissive · top 5,000 on PyPI
django-templated-mailSends Django emails using template files…
permissive · top 15,000 on PyPI
authheadersGenerates and validates email authentication…
permissive · top 15,000 on PyPI
django-post_officeDjango Post Office queues and sends emails…
permissive · top 15,000 on PyPI
dkimpyImplements DKIM (DomainKeys Identified Mail)…
permissive · top 5,000 on PyPI
css-inlineInlines CSS from style and link tags directly…
permissive · top 5,000 on PyPI