Skip to main content

Project Status: Active — The project has reached a stable, usable state and is being actively developed. CI Status coverage pyversions 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.

Installation

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

python3 -m pip install outgoing

Examples

A sample configuration file:

[outgoing]
method = "smtp"
host = "mx.example.com"
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"] = "my.beloved@love.love"
msg["From"] = "me@here.qq"
msg.set_content(
    "Oh my beloved!\n"
    "\n"
    "Wilt thou dine with me on the morrow?\n"
    "\n"
    "We're having hot pockets.\n"
    "\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!
    sender.send(msg)

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
# <https://github.com/jwodder/eletter>:
from eletter import compose

msg1 = compose(
    subject="No.",
    to=["me@here.qq"],
    from_="my.beloved@love.love",
    text=(
        "Hot pockets?  Thou disgusteth me.\n"
        "\n"
        "Pineapple pizza or RIOT.\n"
    ),
)

msg2 = compose(
    subject="I'd like to place an order.",
    to=["pete@za.aa"],
    from_="my.beloved@love.love",
    text="I need the usual.  Twelve Hawaiian Abominations to go, please.\n",
)

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

with outgoing.from_dict(SENDING_CONFIG) as sender:
    sender.send(msg1)
    sender.send(msg2)

Metadata

Release files for outgoing 0.6.3

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

Source distribution (sdist)

Source distribution for outgoing 0.6.3
File Size Uploaded Provenance Actions
outgoing-0.6.3.tar.gz 34.9 kB Without provenance Details for outgoing-0.6.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for outgoing 0.6.3
File Interpreter ABI Platform Actions
outgoing-0.6.3-py3-none-any.whl Python 3 none any Details for outgoing-0.6.3-py3-none-any.whl

Total release size: 54.5 kB

Release files / outgoing-0.6.3.tar.gz

Download URL outgoing-0.6.3.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b3700a6d2dc4429a7224089d1f7735e604e7a4f99e224638e420b7acd7256207
BLAKE2b-256 checksum
How to use checksums
6ae847eff2c4f36472daa32b2d587c947338dddfe1c869126e5b2be0c648639e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / outgoing-0.6.3-py3-none-any.whl

Download URL outgoing-0.6.3-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5854b058a17a0b81faf19a169b325dc5419474f8efeaa094bef6f89a25f76ad
BLAKE2b-256 checksum
How to use checksums
c58869f3513557ccb7d16644ed420b5f01b5b6634c4184e14b313827b9168e0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for outgoing 0.6.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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