littlemail


Namelittlemail JSON
Version 0.32 PyPI version JSON
download
home_page
SummaryCommand-line SMTP email sending tool in Python
upload_time2023-10-05 09:45:00
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT License Copyright (c) 2019 xinlin for maily project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Additional Info: Maily project page https://github.com/xinlin-z/maily Author's python note blog https://www.pynote.net Author's another blog https://www.maixj.net
keywords command line email python smtp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![MasterUpdate](https://github.com/xinlin-z/littlemail/actions/workflows/master_update.yml/badge.svg?branch=master)](https://github.com/xinlin-z/littlemail/actions/workflows/master_update.yml)

# littlemail

* [Installation](#Installation)
* [Usage](#Usage)
* [API](#API)

Littlemail is a straight-forward command-line SMTP email sending tool
in Python, which sends **one email per command**. (If you send many
emails, every sending will make a new connection with the smtp server.)

## Installation

```shell
$ pip install littlemail
```

## Usage

There is no way to reduce parameters provided in command-line, since
that's the way of email. So, please refer to the inline help for options
you need. Fortunately, many options have default value.

``` shell
$ python -m littlemail -h  # inline help
```

Anyway, here is a minimal example and a few lines of explanation:

```shell
$ python -m littlemail -s test [-c hello] \
                -f 12345@qq.com \
                --to 54321@qq.com \
                --smtp smtp.qq.com [-p abcdefg]
```

`-c` means the email content, which is optional. That means you can
send empty-content email. And this optional parameter enables the
capability of littlemail to get content from pipe (input
redirection), which might be easier for you to construct your message,
such as:

```shell
$ python -m littlemail <...> < my_email_content.txt
```

`-s` represents subject, which is mandatory and cannot be empty.

`-p` stands for password, and it is optional. When it's missing,
littlemail tries to get password from `LITTLEMAIL_PASSWD`
environment variable.

When something goes wrong, try `--debug`.

## API

There is an API you can invoke to send email in your code:

```python
# import
from littlemail import send_email
# signature
send_email(subject: str,
           *,
           text: str = '',
           contype: str = 'plain',
           alist: list[str] = [],
           to: list[str],
           cc: list[str] = [],
           bcc: list[str] = [],
           fromaddr: str,
           smtp: str,
           port: int = 587,
           timeout: int = 3,
           protocol: str = 'tls',
           passwd: str|None,
           debug: bool = False) -> None
```

`api_test.py` is used as an example and testcase for you try, have fun! ^___^


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "littlemail",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "command line,email,python,smtp",
    "author": "",
    "author_email": "xinlin-z <xinlin.zhang@hotmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/66/8a/3de8ca9ce35aa6cda069785601e5551b8acdbc00ed884e57d11cceb898c0/littlemail-0.32.tar.gz",
    "platform": null,
    "description": "[![MasterUpdate](https://github.com/xinlin-z/littlemail/actions/workflows/master_update.yml/badge.svg?branch=master)](https://github.com/xinlin-z/littlemail/actions/workflows/master_update.yml)\n\n# littlemail\n\n* [Installation](#Installation)\n* [Usage](#Usage)\n* [API](#API)\n\nLittlemail is a straight-forward command-line SMTP email sending tool\nin Python, which sends **one email per command**. (If you send many\nemails, every sending will make a new connection with the smtp server.)\n\n## Installation\n\n```shell\n$ pip install littlemail\n```\n\n## Usage\n\nThere is no way to reduce parameters provided in command-line, since\nthat's the way of email. So, please refer to the inline help for options\nyou need. Fortunately, many options have default value.\n\n``` shell\n$ python -m littlemail -h  # inline help\n```\n\nAnyway, here is a minimal example and a few lines of explanation:\n\n```shell\n$ python -m littlemail -s test [-c hello] \\\n                -f 12345@qq.com \\\n                --to 54321@qq.com \\\n                --smtp smtp.qq.com [-p abcdefg]\n```\n\n`-c` means the email content, which is optional. That means you can\nsend empty-content email. And this optional parameter enables the\ncapability of littlemail to get content from pipe (input\nredirection), which might be easier for you to construct your message,\nsuch as:\n\n```shell\n$ python -m littlemail <...> < my_email_content.txt\n```\n\n`-s` represents subject, which is mandatory and cannot be empty.\n\n`-p` stands for password, and it is optional. When it's missing,\nlittlemail tries to get password from `LITTLEMAIL_PASSWD`\nenvironment variable.\n\nWhen something goes wrong, try `--debug`.\n\n## API\n\nThere is an API you can invoke to send email in your code:\n\n```python\n# import\nfrom littlemail import send_email\n# signature\nsend_email(subject: str,\n           *,\n           text: str = '',\n           contype: str = 'plain',\n           alist: list[str] = [],\n           to: list[str],\n           cc: list[str] = [],\n           bcc: list[str] = [],\n           fromaddr: str,\n           smtp: str,\n           port: int = 587,\n           timeout: int = 3,\n           protocol: str = 'tls',\n           passwd: str|None,\n           debug: bool = False) -> None\n```\n\n`api_test.py` is used as an example and testcase for you try, have fun! ^___^\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2019 xinlin for maily project  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  Additional Info: Maily project page https://github.com/xinlin-z/maily Author's python note blog https://www.pynote.net Author's another blog https://www.maixj.net",
    "summary": "Command-line SMTP email sending tool in Python",
    "version": "0.32",
    "project_urls": {
        "homepage": "https://github.com/xinlin-z/littlemail"
    },
    "split_keywords": [
        "command line",
        "email",
        "python",
        "smtp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c7019200bec6c744273b31e115aa1cc6b187aa8cc7a0432e92119999df257503",
                "md5": "a28254d2d1ed30911e66022ef265e253",
                "sha256": "784eaafe92ec20f0b8cc9310824f31542f099dbba391ab9c4d8030b4c623e870"
            },
            "downloads": -1,
            "filename": "littlemail-0.32-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a28254d2d1ed30911e66022ef265e253",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6254,
            "upload_time": "2023-10-05T09:44:59",
            "upload_time_iso_8601": "2023-10-05T09:44:59.012785Z",
            "url": "https://files.pythonhosted.org/packages/c7/01/9200bec6c744273b31e115aa1cc6b187aa8cc7a0432e92119999df257503/littlemail-0.32-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "668a3de8ca9ce35aa6cda069785601e5551b8acdbc00ed884e57d11cceb898c0",
                "md5": "eac68b8a8d705f4293101abe18535888",
                "sha256": "67b5e0229cd23a288ed5a78420631bfac29815ef4167adc4f3b9fa4d3d9787b9"
            },
            "downloads": -1,
            "filename": "littlemail-0.32.tar.gz",
            "has_sig": false,
            "md5_digest": "eac68b8a8d705f4293101abe18535888",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6245,
            "upload_time": "2023-10-05T09:45:00",
            "upload_time_iso_8601": "2023-10-05T09:45:00.190383Z",
            "url": "https://files.pythonhosted.org/packages/66/8a/3de8ca9ce35aa6cda069785601e5551b8acdbc00ed884e57d11cceb898c0/littlemail-0.32.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-05 09:45:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xinlin-z",
    "github_project": "littlemail",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "littlemail"
}
        
Elapsed time: 0.12080s