Skip to main content

aiosmtplib

Introduction

Aiosmtplib is an implementation of the python stdlib smtplib using asyncio, for use in asynchronous applications.

Basic usage:

import asyncio
import aiosmtplib
loop = asyncio.get_event_loop()
smtp = aiosmtplib.SMTP(hostname='localhost', port=25, loop=loop)

@asyncio.coroutine
def send_a_message():
    sender = 'root@localhost'
    recipient = 'somebody@localhost'
    message = "Hello World"
    yield from smtp.sendmail(sender, [recipient], message)

asyncio.async(send_a_message())
loop.run_forever()

Connecting to an SMTP server

Use an instance of the SMTP class to connect to a server. Note that if the event loop used to initialize the class is not currently running, it will be started in order to connect.

Sending messages

Use SMTP.sendmail to send raw messages. The method signature is the same as for standard smtplib.

Use SMTP.send_message to send email.message.Message objects. The method signature is the same as for standard smtplib.

Release files for aiosmtplib 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiosmtplib 0.1.2
File Size Uploaded
aiosmtplib-0.1.2.tar.gz 10.2 kB Details

Release files / aiosmtplib-0.1.2.tar.gz

Download URL aiosmtplib-0.1.2.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4f2f5f258d8f722e5d3de179a59d21583846986d1c5f6f358fbdfe2473baa630
BLAKE2b-256 checksum
How to use checksums
5a392b45ea9e1142fe832cf9a565911bd19c4731972dc6ea064f2ad4628d05b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page