Skip to main content

Common interface for multiple e-mail methods

Project description

Project Status: Active — The project has reached a stable, usable state and is being actively developed. CI Status MIT License

GitHub | PyPI | Documentation | Issues | Changelog

outgoing provides a common interface to multiple different e-mail sending methods (SMTP, sendmail, mbox, etc.). Just construct a sender from a configuration file or object, pass it an EmailMessage instance, and let the magical internet daemons take care of the rest.

outgoing itself provides support for only basic sending methods; additional methods are provided by extension packages.

See the documentation for more information.


outgoing requires Python 3.7 or higher. Just use pip for Python 3 (You have pip, right?) to install outgoing and its dependencies:

python3 -m pip install outgoing


A sample configuration file:

method = "smtp"
host = ""
ssl = "starttls"
username = "myname"
password = { file = "~/secrets/smtp-password" }

Sending an e-mail based on a configuration file:

from email.message import EmailMessage
import outgoing

# Construct an EmailMessage object the standard Python way:
msg = EmailMessage()
msg["Subject"] = "Meet me"
msg["To"] = ""
msg["From"] = "me@here.qq"
    "Oh my beloved!\n"
    "Wilt thou dine with me on the morrow?\n"
    "We're having hot pockets.\n"
    "Love, Me\n"

# Construct a sender object based on the default config file (assuming it's
# populated)
with outgoing.from_config_file() as sender:
    # Now send that letter!

As an alternative to using a configuration file, you can specify an explicit configuration by passing the configuration structure to the outgoing.from_dict() method, like so:

from email.message import EmailMessage
import outgoing

# Construct an EmailMessage object using the eletter library
# <>:
from eletter import compose

msg1 = compose(
        "Hot pockets?  Thou disgusteth me.\n"
        "Pineapple pizza or RIOT.\n"

msg2 = compose(
    subject="I'd like to place an order.",
    text="I need the usual.  Twelve Hawaiian Abominations to go, please.\n",

    "method": "smtp",
    "host": "",
    "username": "my.beloved",
    "password": {"env": "SMTP_PASSWORD"},
    "ssl": "starttls",

with outgoing.from_dict(SENDING_CONFIG) as sender:

Download files

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

Source Distribution

outgoing-0.6.0.tar.gz (39.9 kB view hashes)

Uploaded source

Built Distribution

outgoing-0.6.0-py3-none-any.whl (19.6 kB view hashes)

Uploaded py3

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