asyncio SMTP client


Keywords
smtp, email, asyncio, asynchronous, python, smtp-client
License
MIT
Install
pip install aiosmtplib==3.0.1

Documentation

aiosmtplib

"aiosmtplib CircleCI build status" "pre-commit.ci status" codecov "aiosmtplib on the Python Package Index" pypi-status "aiosmtplib on pypy.tech" pypi-python-versions pypi-license


aiosmtplib is an asynchronous SMTP client for use with asyncio.

For documentation, see Read The Docs.

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))

Requirements

Python 3.8+ is required.

Bug Reporting

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