Skip to main content

An asynchronous mail server

Project description

PyMailIO

An Asynchronous mail server that's built on CPython's AsyncIO library.

pip install pymail-io

Quick Start

There are 3 ways to use PyMailIO:

Running PyMailIO as a complete emailing solution:

from pymail_io.pymailio_task import PyMailIOTask

p = PyMailIOTask(
    password="wizard",
    receiver_email="joe@blogs.com", # Or a list of emails receiver_email=["joe@blogs.com", ...],
    sender_email="your_email@gmail.com",
    host="smtp.gmail.com",
)
# Create your email subject & body
email_meta = p.send_email(
    subject="The subject...",
    body="The email body...",
)
# Get a response from your sent email:
res = p.get_email_response(email_meta)
Coming soon:

Running PyMailIO as an asyncio coroutine:

from pymail_io.pymailio_async import PymailIOAsync

p = PymailIOAsync(
    password="wizard",
    receiver_email="joe@blogs.com",
    sender_email="your_email@gmail.com",
    host="smtp.gmail.com",
)
# Create your email subject & body as a coroutine & await
email_meta = await p.send_email(
    subject="The subject...",
    body="The email body...",
)
# Await a response from your sent email as a coroutine:
res = await p.get_email_response(email_meta)
Coming soon:

Running PyMailIO as a synchronous function (You will need to handle blocking & response):

from pymail_io.pymailio_sync import PyMailIOSync

p = PyMailIOSync(
    password="wizard",
    receiver_email="joe@blogs.com",
    sender_email="your_email@gmail.com",
    host="smtp.gmail.com",
)
# Create your email subject & body
email_meta = p.send_email(
    subject="The subject...",
    body="The email body...",
)

Built With

  • PyTaskIO - Asynchronous Tasks Library using asyncio

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

This library is based on & influenced by flask-mail.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymail-io-0.0.2.tar.gz (4.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page