skillfed

aiosmtplib

asyncio SMTP client

aiosmtplib v5.1.2 19.6M downloads/30d#1,059 on PyPI430
Permissive license MIT Active released

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 aiosmtplib

uv

uv add aiosmtplib

poetry

poetry add aiosmtplib

Installing 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

Development Status :: 5 - Production/StableEnvironment :: No Input/Output (Daemon)Framework :: AsyncIOIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentTopic :: CommunicationsTopic :: Communications :: EmailTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

async smtp clientasyncio email sendingnon-blocking smtppython async mailasyncio email library
async-ioemail-delivery

More Libraries packages