aiosmtplib
asyncio SMTP client
What it is and what it does
aiosmtplib is a pure-Python SMTP client built for asyncio that lets you send email without blocking your event loop. Unlike the standard library's synchronous smtplib, it integrates directly into async/await code, making it suitable for applications that handle many concurrent operations—web servers, task queues, or any asyncio-based system that needs to send mail.
The package has no runtime dependencies and installs as a single wheel. It wraps the SMTP protocol in async methods, so you construct an EmailMessage using the standard library's email.message module, then pass it to aiosmtplib.send() or manage a connection manually. Requires Python 3.10 or later.
Use it for:
- Send transactional emails from a FastAPI or Starlette web application without blocking request handlers
- Batch email delivery in an asyncio task queue or background job system
- Integrate email notifications into an async event-driven architecture
- Concurrent mail operations where multiple messages are sent in parallel within a single event loop
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
aiosmtplib is an asynchronous SMTP client that sends email messages using asyncio, allowing non-blocking email operations in async Python applications.
Yes. aiosmtplib is actively maintained, has no dependencies, carries a permissive MIT license, and fills a clear gap for async Python applications that need SMTP. The low install friction and stable production status make it a straightforward choice if you're already using asyncio and need to send email without blocking.
Install
aiosmtplib on PyPI
pip
pip install aiosmtplibuv
uv add aiosmtplibpoetry
poetry add aiosmtplibInstalling aiosmtplib
Before you install
Low install friction with no runtime dependencies. Active maintenance: last commit 2026-08-06, release 55 days ago. Stable production status since first release in 2016.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute aiosmtplib freely provided you retain the license notice.
Quickstart
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))
Requires Python 3.10 or later.
Verify before relying
- Whether TLS/SSL support is included and how to configure it
- Authentication method support (PLAIN, LOGIN, etc.) and configuration
- Connection pooling or session management capabilities
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 55 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 19,588,512/month — #1,059 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiosmtplib-5.1.2-py3-none-any.whl
Keywords: asyncio, email, smtp
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
aiosmtpdaiosmtpd is an asyncio-based SMTP server that…
permissive · top 5,000 on PyPI
yagmailSimplifies sending emails via Gmail or any SMTP…
permissive · top 15,000 on PyPI
fastapi-mailSends emails and attachments asynchronously…
permissive · top 5,000 on PyPI
IMAPClientIMAPClient provides a Pythonic interface to…
permissive · top 5,000 on PyPI
pyserial-asyncioAdds async/await support to pyserial for…
permissive · top 15,000 on PyPI
aioimaplibAn asyncio-based IMAP4rev1 client library that…
copyleft · top 15,000 on PyPI
aiopgaiopg provides asyncio-based access to…
permissive · top 15,000 on PyPI
aiomysqlaiomysql provides async/await access to MySQL…
permissive · top 5,000 on PyPI
apache-airflow-providers-smtpAdds SMTP email sending capabilities to Apache…
permissive · top 5,000 on PyPI
aiomcacheAsyncio-based memcached client providing…
permissive · top 15,000 on PyPI