outgoing


Nameoutgoing JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/jwodder/outgoing
SummaryCommon interface for multiple e-mail methods
upload_time2023-10-30 19:55:08
maintainer
docs_urlNone
authorJohn Thorvald Wodder II
requires_python>=3.7
licenseMIT
keywords e-mail email mailbox mbox send mail sendmail smtp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: http://www.repostatus.org/badges/latest/active.svg
    :target: http://www.repostatus.org/#active
    :alt: Project Status: Active — The project has reached a stable, usable
          state and is being actively developed.

.. image:: https://github.com/jwodder/outgoing/workflows/Test/badge.svg?branch=master
    :target: https://github.com/jwodder/outgoing/actions?workflow=Test
    :alt: CI Status

.. image:: https://codecov.io/gh/jwodder/outgoing/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/jwodder/outgoing

.. image:: https://img.shields.io/pypi/pyversions/outgoing.svg
    :target: https://pypi.org/project/outgoing/

.. 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.7 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": "https://github.com/jwodder/outgoing",
    "name": "outgoing",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "e-mail,email,mailbox,mbox,send mail,sendmail,smtp",
    "author": "John Thorvald Wodder II",
    "author_email": "outgoing@varonathe.org",
    "download_url": "https://files.pythonhosted.org/packages/c1/d0/dd091cb50e6234adf8345179127cb31997f79039f5c37d1db0248420d824/outgoing-0.6.0.tar.gz",
    "platform": null,
    "description": ".. image:: http://www.repostatus.org/badges/latest/active.svg\n    :target: http://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.. image:: https://github.com/jwodder/outgoing/workflows/Test/badge.svg?branch=master\n    :target: https://github.com/jwodder/outgoing/actions?workflow=Test\n    :alt: CI Status\n\n.. image:: https://codecov.io/gh/jwodder/outgoing/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/jwodder/outgoing\n\n.. image:: https://img.shields.io/pypi/pyversions/outgoing.svg\n    :target: https://pypi.org/project/outgoing/\n\n.. 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.7 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": "MIT",
    "summary": "Common interface for multiple e-mail methods",
    "version": "0.6.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/jwodder/outgoing/issues",
        "Documentation": "https://outgoing.readthedocs.io",
        "Homepage": "https://github.com/jwodder/outgoing",
        "Source Code": "https://github.com/jwodder/outgoing"
    },
    "split_keywords": [
        "e-mail",
        "email",
        "mailbox",
        "mbox",
        "send mail",
        "sendmail",
        "smtp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cec7fb82f2432840fb6c7e3b8d10b7f9bfd8ec4c93fe4f687cc0a19c891a6a27",
                "md5": "03678b0a985d801b9bb9b4e8b8b12851",
                "sha256": "4de9f0aee0e837a2049b85a8186108e3261e9817b8aacfa7b2f1ce1253349114"
            },
            "downloads": -1,
            "filename": "outgoing-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "03678b0a985d801b9bb9b4e8b8b12851",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 19560,
            "upload_time": "2023-10-30T19:55:07",
            "upload_time_iso_8601": "2023-10-30T19:55:07.200337Z",
            "url": "https://files.pythonhosted.org/packages/ce/c7/fb82f2432840fb6c7e3b8d10b7f9bfd8ec4c93fe4f687cc0a19c891a6a27/outgoing-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c1d0dd091cb50e6234adf8345179127cb31997f79039f5c37d1db0248420d824",
                "md5": "e1c877fbb1c031639336cb92b999ff7e",
                "sha256": "f762d0f69574f3332d64f994b479282a90e6523fe09baf8334303f2e4456309d"
            },
            "downloads": -1,
            "filename": "outgoing-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e1c877fbb1c031639336cb92b999ff7e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 39913,
            "upload_time": "2023-10-30T19:55:08",
            "upload_time_iso_8601": "2023-10-30T19:55:08.769100Z",
            "url": "https://files.pythonhosted.org/packages/c1/d0/dd091cb50e6234adf8345179127cb31997f79039f5c37d1db0248420d824/outgoing-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-30 19:55:08",
    "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"
}
        
Elapsed time: 0.19716s