---
title: "emails | pypx"
description: "Modern python library for emails."
canonical_url: "https://pypx.app/packages/emails"
meta:
  "og:description": "Modern python library for emails."
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_emails%2Cversion_1.1.3%2Csummary_Modern%2Bpython%2Blibrary%2Bfor%2Bemails.%2Clicense_Apache%2BSoftware%2BLicense%2Cp_Ii9wYWNrYWdlcy9lbWFpbHMi%2Cs_BdBTWZSrV4gGfV55.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "emails 1.1.3"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_emails%2Cversion_1.1.3%2Csummary_Modern%2Bpython%2Blibrary%2Bfor%2Bemails.%2Clicense_Apache%2BSoftware%2BLicense%2Cp_Ii9wYWNrYWdlcy9lbWFpbHMi%2Cs_BdBTWZSrV4gGfV55.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **emails**

v1.1.3

Modern python library for emails.

43 KB Python 3.10+ py3-none-anyApache Software License3 deps

[** Diff **](https://pypx.app/packages/emails/diff)

`$ uv add emails`

# python-emails

[![PyPI version](https://img.shields.io/pypi/v/emails.svg)](https://pypi.org/project/emails/) [![Python versions](https://img.shields.io/pypi/pyversions/emails.svg)](https://pypi.org/project/emails/) [![Test status](https://github.com/lavr/python-emails/workflows/Tests/badge.svg?branch=master)](https://github.com/lavr/python-emails/actions?query=workflow%3ATests) [![Documentation status](https://readthedocs.org/projects/python-emails/badge/?version=latest)](https://python-emails.readthedocs.io/) [![License](https://img.shields.io/pypi/l/emails.svg)](https://github.com/lavr/python-emails/blob/master/LICENSE)

Build, transform, and send emails in Python with a high-level API.

python-emails helps you compose HTML and plain-text messages, attach files, embed inline images, render templates, apply HTML transformations, sign with DKIM, and send through SMTP without hand-building MIME trees.

## Why python-emails

- A concise API over email and smtplib
- HTML and plain-text messages in one object
- File attachments and inline images
- CSS inlining, image embedding, and HTML cleanup
- Jinja2, Mako, and string template support
- DKIM signing
- Loaders for URLs, HTML files, directories, ZIP archives, and RFC 822 messages
- SMTP sending with SSL/TLS support
- Async sending via aiosmtplib

## Quick Example

```python
import emails

message = emails.html(
    subject="Your receipt",
    html="<p>Hello!</p><p>Your payment was received.</p>",
    mail_from=("Billing", "billing@example.com"),
)
message.attach(filename="receipt.pdf", data=open("receipt.pdf", "rb"))

response = message.send(
    to="customer@example.com",
    smtp={
        "host": "smtp.example.com",
        "port": 587,
        "tls": True,
        "user": "billing@example.com",
        "password": "app-password",
    },
)
assert response.status_code == 250
```

## Installation

Install the lightweight core:

```bash
pip install emails
```

Install HTML transformation features such as CSS inlining, image embedding, and loading from URLs or files:

```bash
pip install "emails[html]"
```

Install Jinja2 template support for the JinjaTemplate class:

```bash
pip install "emails[jinja]"
```

Install async SMTP sending support for send\_async():

```bash
pip install "emails[async]"
```

## Common Tasks

- Build and send your first message:

[Quickstart](https://python-emails.readthedocs.io/en/latest/quickstart.html)

- Configure installation extras:

[Install guide](https://python-emails.readthedocs.io/en/latest/install.html)

- Inline CSS, embed images, and customize HTML processing:

[Advanced Usage](https://python-emails.readthedocs.io/en/latest/advanced.html)

- Learn the full public API:

[API Reference](https://python-emails.readthedocs.io/en/latest/api.html)

- Troubleshoot common scenarios:

[FAQ](https://python-emails.readthedocs.io/en/latest/faq.html)

- Explore alternatives and related projects:

[Links](https://python-emails.readthedocs.io/en/latest/links.html)

## What You Get

- Message composition for HTML, plain text, headers, CC/BCC, and Reply-To
- Attachments, inline images, and MIME generation
- Template rendering in html, text, and subject
- HTML transformations through message.transform()
- SMTP delivery through config dicts or reusable backend objects
- Django integration via DjangoMessage
- Flask integration via [flask-emails](https://github.com/lavr/flask-emails)

## When To Use It

Use python-emails when you need more than a minimal plain-text SMTP call: HTML emails, attachments, inline images, template rendering, DKIM, message loading from external sources, or a cleaner API than hand-written email.mime code.

If you only need to send a very small plain-text message and want zero dependencies, the standard library may be enough.

## Documentation

- [Documentation home](https://python-emails.readthedocs.io/)
- [Quickstart](https://python-emails.readthedocs.io/en/latest/quickstart.html)
- [Advanced Usage](https://python-emails.readthedocs.io/en/latest/advanced.html)
- [API Reference](https://python-emails.readthedocs.io/en/latest/api.html)
- [FAQ](https://python-emails.readthedocs.io/en/latest/faq.html)

## Project Status

python-emails is production/stable software and currently supports Python 3.10 through 3.14.

## Contributing

Issues and pull requests are welcome.

- [Report a bug or request a feature](https://github.com/lavr/python-emails/issues)
- [Source code on GitHub](https://github.com/lavr/python-emails)
- [How to Help](https://python-emails.readthedocs.io/en/latest/howtohelp.html)

## License

Apache 2.0. See [LICENSE](https://github.com/lavr/python-emails/blob/master/LICENSE).

## **Details **

<dl>

<dt>Version</dt>
<dd>1.1.3</dd>

<dt>License</dt>
<dd>Apache Software License</dd>

<dt>Python</dt>
<dd>&gt;=3.10</dd>

<dt>Maintainer</dt>
<dd>Sergey Lavrinenko</dd></dl>

## **Links**

- [Homepage](https://github.com/lavr/python-emails)
- [View on PyPI](https://pypi.org/project/emails/)

## **Release Cadence **

**7**

releases in the past year

avg 92 days between releases

## **Maintainers **

- Sergey Lavrinenko · [s@lavr.me](mailto:s@lavr.me)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/emails#webpage","@type":"WebPage","description":"Modern python library for emails.","name":"emails","url":"https://pypx.app/packages/emails","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/emails"]}]},{"@id":"https://pypx.app/packages/emails#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"Modern python library for emails.","license":"Apache Software License","name":"emails","softwareVersion":"1.1.3"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
