|repostatus| |ci-status| |coverage| |pyversions| |license|
.. |repostatus| image:: https://www.repostatus.org/badges/latest/active.svg
:target: https://www.repostatus.org/#active
:alt: Project Status: Active — The project has reached a stable, usable
state and is being actively developed.
.. |ci-status| image:: https://github.com/jwodder/outgoing/actions/workflows/test.yml/badge.svg
:target: https://github.com/jwodder/outgoing/actions/workflows/test.yml
:alt: CI Status
.. |coverage| image:: https://codecov.io/gh/jwodder/outgoing/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jwodder/outgoing
.. |pyversions| image:: https://img.shields.io/pypi/pyversions/outgoing.svg
:target: https://pypi.org/project/outgoing/
.. |license| image:: https://img.shields.io/github/license/jwodder/outgoing.svg
:target: https://opensource.org/licenses/MIT
:alt: MIT License
`GitHub <https://github.com/jwodder/outgoing>`_
| `PyPI <https://pypi.org/project/outgoing/>`_
| `Documentation <https://outgoing.readthedocs.io>`_
| `Issues <https://github.com/jwodder/outgoing/issues>`_
| `Changelog <https://github.com/jwodder/outgoing/blob/master/CHANGELOG.md>`_
``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 <https://outgoing.readthedocs.io>`_ for more
information.
Installation
============
``outgoing`` requires Python 3.8 or higher. Just use `pip
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install
``outgoing`` and its dependencies::
python3 -m pip install outgoing
Examples
========
A sample configuration file:
.. code:: toml
[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:
.. code:: python
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:
.. code:: python
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)
Raw data
{
"_id": null,
"home_page": null,
"name": "outgoing",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "e-mail, email, mailbox, mbox, send mail, sendmail, smtp",
"author": null,
"author_email": "John Thorvald Wodder II <outgoing@varonathe.org>",
"download_url": "https://files.pythonhosted.org/packages/8e/c1/efff15f88488704f70b10a5a106525fadc2ba97ebc0ebaae9c5832519a75/outgoing-0.6.1.tar.gz",
"platform": null,
"description": "|repostatus| |ci-status| |coverage| |pyversions| |license|\n\n.. |repostatus| image:: https://www.repostatus.org/badges/latest/active.svg\n :target: https://www.repostatus.org/#active\n :alt: Project Status: Active \u2014 The project has reached a stable, usable\n state and is being actively developed.\n\n.. |ci-status| image:: https://github.com/jwodder/outgoing/actions/workflows/test.yml/badge.svg\n :target: https://github.com/jwodder/outgoing/actions/workflows/test.yml\n :alt: CI Status\n\n.. |coverage| image:: https://codecov.io/gh/jwodder/outgoing/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/jwodder/outgoing\n\n.. |pyversions| image:: https://img.shields.io/pypi/pyversions/outgoing.svg\n :target: https://pypi.org/project/outgoing/\n\n.. |license| image:: https://img.shields.io/github/license/jwodder/outgoing.svg\n :target: https://opensource.org/licenses/MIT\n :alt: MIT License\n\n`GitHub <https://github.com/jwodder/outgoing>`_\n| `PyPI <https://pypi.org/project/outgoing/>`_\n| `Documentation <https://outgoing.readthedocs.io>`_\n| `Issues <https://github.com/jwodder/outgoing/issues>`_\n| `Changelog <https://github.com/jwodder/outgoing/blob/master/CHANGELOG.md>`_\n\n``outgoing`` provides a common interface to multiple different e-mail sending\nmethods (SMTP, sendmail, mbox, etc.). Just construct a sender from a\nconfiguration file or object, pass it an ``EmailMessage`` instance, and let the\nmagical internet daemons take care of the rest.\n\n``outgoing`` itself provides support for only basic sending methods; additional\nmethods are provided by extension packages.\n\nSee `the documentation <https://outgoing.readthedocs.io>`_ for more\ninformation.\n\n\nInstallation\n============\n``outgoing`` requires Python 3.8 or higher. Just use `pip\n<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install\n``outgoing`` and its dependencies::\n\n python3 -m pip install outgoing\n\n\nExamples\n========\n\nA sample configuration file:\n\n.. code:: toml\n\n [outgoing]\n method = \"smtp\"\n host = \"mx.example.com\"\n ssl = \"starttls\"\n username = \"myname\"\n password = { file = \"~/secrets/smtp-password\" }\n\n\nSending an e-mail based on a configuration file:\n\n.. code:: python\n\n from email.message import EmailMessage\n import outgoing\n\n # Construct an EmailMessage object the standard Python way:\n msg = EmailMessage()\n msg[\"Subject\"] = \"Meet me\"\n msg[\"To\"] = \"my.beloved@love.love\"\n msg[\"From\"] = \"me@here.qq\"\n msg.set_content(\n \"Oh my beloved!\\n\"\n \"\\n\"\n \"Wilt thou dine with me on the morrow?\\n\"\n \"\\n\"\n \"We're having hot pockets.\\n\"\n \"\\n\"\n \"Love, Me\\n\"\n )\n\n # Construct a sender object based on the default config file (assuming it's\n # populated)\n with outgoing.from_config_file() as sender:\n # Now send that letter!\n sender.send(msg)\n\n\nAs an alternative to using a configuration file, you can specify an explicit\nconfiguration by passing the configuration structure to the\n``outgoing.from_dict()`` method, like so:\n\n.. code:: python\n\n from email.message import EmailMessage\n import outgoing\n\n # Construct an EmailMessage object using the eletter library\n # <https://github.com/jwodder/eletter>:\n from eletter import compose\n\n msg1 = compose(\n subject=\"No.\",\n to=[\"me@here.qq\"],\n from_=\"my.beloved@love.love\",\n text=(\n \"Hot pockets? Thou disgusteth me.\\n\"\n \"\\n\"\n \"Pineapple pizza or RIOT.\\n\"\n ),\n )\n\n msg2 = compose(\n subject=\"I'd like to place an order.\",\n to=[\"pete@za.aa\"],\n from_=\"my.beloved@love.love\",\n text=\"I need the usual. Twelve Hawaiian Abominations to go, please.\\n\",\n )\n\n SENDING_CONFIG = {\n \"method\": \"smtp\",\n \"host\": \"smtp.love.love\",\n \"username\": \"my.beloved\",\n \"password\": {\"env\": \"SMTP_PASSWORD\"},\n \"ssl\": \"starttls\",\n }\n\n with outgoing.from_dict(SENDING_CONFIG) as sender:\n sender.send(msg1)\n sender.send(msg2)\n",
"bugtrack_url": null,
"license": null,
"summary": "Common interface for multiple e-mail methods",
"version": "0.6.1",
"project_urls": {
"Bug Tracker": "https://github.com/jwodder/outgoing/issues",
"Documentation": "https://outgoing.readthedocs.io",
"Source Code": "https://github.com/jwodder/outgoing"
},
"split_keywords": [
"e-mail",
" email",
" mailbox",
" mbox",
" send mail",
" sendmail",
" smtp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1a2f2ad853a1b61d6f97d70d063860dcd376fc48302f8ffdc2c72098c17f6a08",
"md5": "f0d9dfe4e5aad5c3bcb499483566f413",
"sha256": "3b51b6c247b3c8b16ec72a868c127543cc7c2b93ba315ad40336197f4c8b0d5c"
},
"downloads": -1,
"filename": "outgoing-0.6.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f0d9dfe4e5aad5c3bcb499483566f413",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 19397,
"upload_time": "2024-05-08T18:33:47",
"upload_time_iso_8601": "2024-05-08T18:33:47.511210Z",
"url": "https://files.pythonhosted.org/packages/1a/2f/2ad853a1b61d6f97d70d063860dcd376fc48302f8ffdc2c72098c17f6a08/outgoing-0.6.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8ec1efff15f88488704f70b10a5a106525fadc2ba97ebc0ebaae9c5832519a75",
"md5": "718c4d3e13577311ae25fbfd2749b2d0",
"sha256": "deb115ea9180ef258d263e7252d47b9e251873ceb0d67082f10eafa6c4e1aef4"
},
"downloads": -1,
"filename": "outgoing-0.6.1.tar.gz",
"has_sig": false,
"md5_digest": "718c4d3e13577311ae25fbfd2749b2d0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 34478,
"upload_time": "2024-05-08T18:33:48",
"upload_time_iso_8601": "2024-05-08T18:33:48.913525Z",
"url": "https://files.pythonhosted.org/packages/8e/c1/efff15f88488704f70b10a5a106525fadc2ba97ebc0ebaae9c5832519a75/outgoing-0.6.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-08 18:33:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jwodder",
"github_project": "outgoing",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "outgoing"
}