# aiosmtplib

> asyncio SMTP client

- **URL**: https://www.freshcrate.ai/projects/aiosmtplib
- **Author**: pypi
- **Category**: Frameworks
- **Latest version**: `v5.1.1` (2026-05-31)
- **License**: MIT
- **Source**: https://github.com/cole/aiosmtplib/blob/main/CHANGELOG.rst
- **Homepage**: https://pypi.org/project/aiosmtplib/
- **Language**: Python
- **GitHub**: 422 stars, 54 forks
- **Registry**: pypi (`aiosmtplib`)
- **Tags**: `asyncio`, `email`, `pypi`, `smtp`

## Description

aiosmtplib
==========

|circleci| |precommit.ci| |codecov| |zero-deps| |pypi-version| |downloads| |pypi-license|

------------

aiosmtplib is an asynchronous SMTP client for use with asyncio.

For documentation, see `Read The Docs`_.

Quickstart
----------


..
  start quickstart

.. code-block:: python

    import asyncio
    from email.message import EmailMessage

    import aiosmtplib

    message = EmailMessage()
    message["From"] = "root@localhost"
    message["To"] = "somebody@example.com"
    message["Subject"] = "Hello World!"
    message.set_content("Sent via aiosmtplib")

    asyncio.run(aiosmtplib.send(message, hostname="127.0.0.1", port=25))

..
  end quickstart

Requirements
------------

..
  start requirements

Python 3.10+ is required.

..
  end requirements


Bug Reporting
-------------

..
  start bug-reporting

Bug reports (and feature requests) are welcome via `Github issues`_.

.. _Github issues: https://github.com/cole/aiosmtplib/issues

..
  end bug-reporting


.. |circleci| image:: https://circleci.com/gh/cole/aiosmtplib/tree/main.svg?style=shield
           :target: https://circleci.com/gh/cole/aiosmtplib/tree/main
           :alt: "aiosmtplib CircleCI build status"
.. |pypi-version| image:: https://img.shields.io/pypi/v/aiosmtplib.svg
                 :target: https://pypi.python.org/pypi/aiosmtplib
                 :alt: "aiosmtplib on the Python Package Index"
.. |pypi-status| image:: https://img.shields.io/pypi/status/aiosmtplib.svg
.. |pypi-license| image:: https://img.shields.io/pypi/l/aiosmtplib.svg
.. |codecov| image:: https://codecov.io/gh/cole/aiosmtplib/branch/main/graph/badge.svg
             :target: https://codecov.io/gh/cole/aiosmtplib
.. |downloads| image:: https://static.pepy.tech/badge/aiosmtplib/month
               :target: https://pepy.tech/project/aiosmtplib
               :alt: "aiosmtplib on pypy.tech"
.. |precommit.ci| image:: https://results.pre-commit.ci/badge/github/cole/aiosmtplib/main.svg
                  :target: https://results.pre-commit.ci/latest/github/cole/aiosmtplib/main
                  :alt: "pre-commit.ci status"
.. |zero-deps| image:: https://0dependencies.dev/0dependencies.svg
               :target: https://0dependencies.dev
               :alt: "0 dependencies"
.. _Read The Docs: https://aiosmtplib.readthedocs.io/en/stable/

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `v5.1.1` | 2026-05-31 | High | ## What's Changed  * Security: Reject control characters (the C0 range 0x00-0x1F and DEL 0x7F, including CR, LF, and NUL) in SMTP command arguments, preventing command injection via input passed to mail(), rcpt(), vrfy(), expn() or sendmail(). Such input now raises ValueError before anything is written to the connection. More details: https://github.com/cole/aiosmtplib/security/advisories/GHSA-v3q9-hj7j-63hq Thanks to @tonghuaroot for the report. * Bugfix: SMTP.quit() no longer hangs until th |
| `5.1.0` | 2026-04-21 | Low | Imported from PyPI (5.1.0) |
| `v5.1.0` | 2026-01-25 | Low | ## What's Changed  * Feature: Add XOAUTH2 authentication support    **Full Changelog**: https://github.com/cole/aiosmtplib/compare/v5.0.0...v5.1.0 |
| `v5.1.0` | 2026-01-25 | Low | ## What's Changed  * Feature: Add XOAUTH2 authentication support    **Full Changelog**: https://github.com/cole/aiosmtplib/compare/v5.0.0...v5.1.0 |
| `v5.1.0` | 2026-01-25 | Low | ## What's Changed  * Feature: Add XOAUTH2 authentication support    **Full Changelog**: https://github.com/cole/aiosmtplib/compare/v5.0.0...v5.1.0 |
| `v5.1.0` | 2026-01-25 | Low | ## What's Changed  * Feature: Add XOAUTH2 authentication support    **Full Changelog**: https://github.com/cole/aiosmtplib/compare/v5.0.0...v5.1.0 |
| `v5.1.0` | 2026-01-25 | Low | ## What's Changed  * Feature: Add XOAUTH2 authentication support    **Full Changelog**: https://github.com/cole/aiosmtplib/compare/v5.0.0...v5.1.0 |
| `v5.1.0` | 2026-01-25 | Low | ## What's Changed  * Feature: Add XOAUTH2 authentication support    **Full Changelog**: https://github.com/cole/aiosmtplib/compare/v5.0.0...v5.1.0 |
| `v5.1.0` | 2026-01-25 | Low | ## What's Changed  * Feature: Add XOAUTH2 authentication support    **Full Changelog**: https://github.com/cole/aiosmtplib/compare/v5.0.0...v5.1.0 |
| `v5.1.0` | 2026-01-25 | Low | ## What's Changed  * Feature: Add XOAUTH2 authentication support    **Full Changelog**: https://github.com/cole/aiosmtplib/compare/v5.0.0...v5.1.0 |

## Dependency audit

- **Score**: 88/100
- **Total deps**: 5
- **Resolved**: 2
- **Unresolved**: 3
- **License conflicts**: 0
- **Warnings**: 0
- **Scanned**: 2026-05-18

## Citation

- HTML: https://www.freshcrate.ai/projects/aiosmtplib
- Markdown: https://www.freshcrate.ai/projects/aiosmtplib.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/aiosmtplib/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
