Metadata-Version: 2.1
Name: littlemail
Version: 0.31
Summary: Command-line SMTP email sending tool in pure Python
Project-URL: homepage, https://github.com/xinlin-z/littlemail
Author-email: xinlin-z <xinlin.zhang@hotmail.com>
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
License-File: LICENSE
Keywords: command line,email,python,smtp
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown

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

# Intro

Littlemail is a command-line SMTP email sending tool in pure Python, which
send **one email per command**.

The purpose of repo is to have a very simple and easy-to-use
command-line SMTP email sending tool in pure Python.
(I think mail or mailx is a bit complicated in use.)

# Installation

```shell
$ pip install littlemail
```

# Usage

Show help and **default values** for a few options:

``` shell
$ python -m littlemail -h
```

Example:

```shell
$ python -m littlemail -s test -c hello -f 12345@qq.com --to 54321@qq.com -p abcde --smtp smtp.qq.com --protocol tls
```

`-c` is optional, which means you can send email with empty content.
And there are two other ways to fill content. Below are examples:

(1) By using echo and pipe, you can insert escape character in command line
into your content:

```shell
$ echo -e 'hello\n\nI am xinlin-z!\n\nBR\nxinlin-z' | python -m littlemail <...>
```

(2) By using input redirection:

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

`-a` option can accept more than one attachments, like:

```shell
$ python -m littlemail <...> -a afile.tar.gz bfile.py cfile.txt <...>
```

If there is something wrong, try to add `--debug` option to check.

`--to`, `--cc` and `--bcc` options are all support multiple addresses.

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

# API

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

```python
from littlemail import send_email
```

Have fun! ^___^

