Name | smvp JSON |
Version |
0.2.5
JSON |
| download |
home_page | None |
Summary | Send a formatted email from the command line |
upload_time | 2025-01-26 21:04:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright 2025 Peter Nardi 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 NON-INFRINGEMENT. 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. |
keywords |
ansi
cron
html
logs
mail
mime
python
scripting
send
sendmail
smvp
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Send Mail Via Python (smvp)
<br>
<img src="https://lh3.googleusercontent.com/d/1PpjTCw4T1HpHU_TacQSjZptzw67WqwIz"
alt="smvp logo" width="120"/>
The _smvp_ utility takes a file whose contents will be parsed and
packaged into the body of an email message, then sent to a designated
email address. The input file can be a text file with ANSI color codes,
HTML, or plain text. The resulting email will be sent as a multi-part
MIME message that renders properly in both plain text and HTML.
> **Note:** The file itself is not sent as an attachment; instead, the
> contents of the file are put into the body of the email.
## Use Case
There are probably a few, but I wrote _smvp_ for two primary reasons:
1. I found that fiddling with `postfix` and `sendmail` was a pain.
2. I want my cron scripts to email me status information and the
contents of various log files. Some of the files contain ANSI escape
sequences for terminal colors. The _smvp_ utility converts those ANSI
escape sequences into proper HTML tags, so the emails I get are nicely
formatted. You could set `$MAILTO` in your crontab, but you won't get
proper handling of ANSI escape sequences, and refer to number 1 above.
## Installation
Use your preferred Python package installer for command line tools, for
example:
```text
pipx install smvp
```
or
```text
uv tool install smvp
```
or
```text
python3 -m venv .venv
source .venv/bin/activate
pip3 install smvp
```
## Requirements
### First
Make sure the following environment variables are set and exported in
your current shell:
```text
export SMVP_USER="<your email>" # e.g. "myemail@gmail.com"
export SMVP_TOKEN="<your token>" # e.g. "<gmail app password>"
export SMVP_SERVER="<smtp server>" # e.g. "smtp.gmail.com"
```
It is recommended that you put the lines above in your "rc" file
(`.bashrc`, `.zshrc`, etc.) for use across multiple shell sessions and
processes. To confirm you have the environment variables correctly set
(with the correct spellings), run this in a terminal:
```text
set | grep ^SMVP_
```
> **Note:** If you make changes to your "rc" file, make sure to `source`
> it or open a new terminal window before running _smvp_ again.
---
> **Tip:** If you're using `cron` and sending mail with _smvp_ from
> within a script, make sure to include the environment variables at the
> top of your `crontab` so your scripts will have access to them during
> execution. Also include a line in your script that exports the
> directory path where your Python tool installer puts things. For
> example, if you're using `uv` on Ubuntu, you would put something like
> this near the top of your bash script:
```bash
# Setup PATH export so the script can find installed Python tools
export PATH="$PATH:/home/<yourhome>/.local/bin"
```
### Second
The `SMVP_SERVER` you select must support secure TLS connections on
port `587`. Check the SMTP settings for your email provider. This is the
default TLS port on Gmail, so if you're using your Gmail account to send
emails, you're good to go.
## Styling
_smvp_ offers custom font and font size options for your email. The
default font for formatted HTML email is `Courier New`, `12px`. Beyond
the default, you can choose any font size from `2px` up to and including
`100px`, from among these font families:
```text
"Andale Mono", "Arial", "Brush Script MT", "Comic Sans MS",
"Courier New", "Garamond", "Georgia", "Helvetica", "Impact",
"Luminari", "Monaco", "Tahoma", "Times New Roman", "Trebuchet MS",
"Verdana", "fantasy", "monospace", "sans-serif", "serif"
```
> **Note:** Not every font will render properly on every device. When in
> doubt, fonts like: "monospace", "sans-serif", "fantasy", and "serif"
> are pretty safe. You may just have to try a few options to land on the
> right one for your use case.
## Usage
```text
usage: smvp [-h] [-f FONT_FAMILY] [-s FONT_SIZE] [-v] recipient subject file
```
For example:
```text
smvp friend@gmail.com "Hello, Friend" ~/logfile.txt -f "Trebuchet MS" -s 14
```
For more details, run:
```text
smvp -h
```
Raw data
{
"_id": null,
"home_page": null,
"name": "smvp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ansi, cron, html, logs, mail, mime, python, scripting, send, sendmail, smvp",
"author": null,
"author_email": "Peter Nardi <geozeke@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/59/13/e02ba5959861b1755e095397c80ef85481d8e6ebfe6cac96829b1911dced/smvp-0.2.5.tar.gz",
"platform": null,
"description": "# Send Mail Via Python (smvp)\n\n<br>\n\n<img src=\"https://lh3.googleusercontent.com/d/1PpjTCw4T1HpHU_TacQSjZptzw67WqwIz\"\nalt=\"smvp logo\" width=\"120\"/>\n\nThe _smvp_ utility takes a file whose contents will be parsed and\npackaged into the body of an email message, then sent to a designated\nemail address. The input file can be a text file with ANSI color codes,\nHTML, or plain text. The resulting email will be sent as a multi-part\nMIME message that renders properly in both plain text and HTML.\n\n> **Note:** The file itself is not sent as an attachment; instead, the\n> contents of the file are put into the body of the email.\n\n## Use Case\n\nThere are probably a few, but I wrote _smvp_ for two primary reasons:\n\n1. I found that fiddling with `postfix` and `sendmail` was a pain.\n2. I want my cron scripts to email me status information and the\ncontents of various log files. Some of the files contain ANSI escape\nsequences for terminal colors. The _smvp_ utility converts those ANSI\nescape sequences into proper HTML tags, so the emails I get are nicely\nformatted. You could set `$MAILTO` in your crontab, but you won't get\nproper handling of ANSI escape sequences, and refer to number 1 above.\n\n## Installation\n\nUse your preferred Python package installer for command line tools, for\nexample:\n\n```text\npipx install smvp\n```\n\nor\n\n```text\nuv tool install smvp\n```\n\nor\n\n```text\npython3 -m venv .venv\nsource .venv/bin/activate\npip3 install smvp\n```\n\n## Requirements\n\n### First\n\nMake sure the following environment variables are set and exported in\nyour current shell:\n\n```text\nexport SMVP_USER=\"<your email>\" # e.g. \"myemail@gmail.com\"\nexport SMVP_TOKEN=\"<your token>\" # e.g. \"<gmail app password>\"\nexport SMVP_SERVER=\"<smtp server>\" # e.g. \"smtp.gmail.com\"\n```\n\nIt is recommended that you put the lines above in your \"rc\" file\n(`.bashrc`, `.zshrc`, etc.) for use across multiple shell sessions and\nprocesses. To confirm you have the environment variables correctly set\n(with the correct spellings), run this in a terminal:\n\n```text\nset | grep ^SMVP_\n```\n\n> **Note:** If you make changes to your \"rc\" file, make sure to `source`\n> it or open a new terminal window before running _smvp_ again.\n\n---\n\n> **Tip:** If you're using `cron` and sending mail with _smvp_ from\n> within a script, make sure to include the environment variables at the\n> top of your `crontab` so your scripts will have access to them during\n> execution. Also include a line in your script that exports the\n> directory path where your Python tool installer puts things. For\n> example, if you're using `uv` on Ubuntu, you would put something like\n> this near the top of your bash script:\n\n```bash\n# Setup PATH export so the script can find installed Python tools\nexport PATH=\"$PATH:/home/<yourhome>/.local/bin\"\n```\n\n### Second\n\nThe `SMVP_SERVER` you select must support secure TLS connections on\nport `587`. Check the SMTP settings for your email provider. This is the\ndefault TLS port on Gmail, so if you're using your Gmail account to send\nemails, you're good to go.\n\n## Styling\n\n_smvp_ offers custom font and font size options for your email. The\ndefault font for formatted HTML email is `Courier New`, `12px`. Beyond\nthe default, you can choose any font size from `2px` up to and including\n`100px`, from among these font families:\n\n```text\n\"Andale Mono\", \"Arial\", \"Brush Script MT\", \"Comic Sans MS\",\n\"Courier New\", \"Garamond\", \"Georgia\", \"Helvetica\", \"Impact\",\n\"Luminari\", \"Monaco\", \"Tahoma\", \"Times New Roman\", \"Trebuchet MS\",\n\"Verdana\", \"fantasy\", \"monospace\", \"sans-serif\", \"serif\"\n```\n\n> **Note:** Not every font will render properly on every device. When in\n> doubt, fonts like: \"monospace\", \"sans-serif\", \"fantasy\", and \"serif\"\n> are pretty safe. You may just have to try a few options to land on the\n> right one for your use case.\n\n## Usage\n\n```text\nusage: smvp [-h] [-f FONT_FAMILY] [-s FONT_SIZE] [-v] recipient subject file\n```\n\nFor example:\n\n```text\nsmvp friend@gmail.com \"Hello, Friend\" ~/logfile.txt -f \"Trebuchet MS\" -s 14\n```\n\nFor more details, run:\n\n```text\nsmvp -h\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright 2025 Peter Nardi 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 NON-INFRINGEMENT. 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.",
"summary": "Send a formatted email from the command line",
"version": "0.2.5",
"project_urls": {
"Bug Tracker": "https://github.com/geozeke/smvp/issues",
"Source Code": "https://github.com/geozeke/smvp"
},
"split_keywords": [
"ansi",
" cron",
" html",
" logs",
" mail",
" mime",
" python",
" scripting",
" send",
" sendmail",
" smvp"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "70d71766024dbf9970f027a156898cda10d5a4fbd496cc4c06c1e8ab50179d49",
"md5": "59fa84f4c3f8a5d39bb5c4324c89d9c7",
"sha256": "af90641bd00cfe627dfec0c57827615be37131f660ee77496115fd41bd35d936"
},
"downloads": -1,
"filename": "smvp-0.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "59fa84f4c3f8a5d39bb5c4324c89d9c7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 11682,
"upload_time": "2025-01-26T21:04:40",
"upload_time_iso_8601": "2025-01-26T21:04:40.572982Z",
"url": "https://files.pythonhosted.org/packages/70/d7/1766024dbf9970f027a156898cda10d5a4fbd496cc4c06c1e8ab50179d49/smvp-0.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5913e02ba5959861b1755e095397c80ef85481d8e6ebfe6cac96829b1911dced",
"md5": "0531a3565ee2f8b45077fbd6232d1a8c",
"sha256": "b0a3dd6a949fee3fc7555f8aa9c91964f829ddb6ea1fb8a95f2468ff67057460"
},
"downloads": -1,
"filename": "smvp-0.2.5.tar.gz",
"has_sig": false,
"md5_digest": "0531a3565ee2f8b45077fbd6232d1a8c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 10288,
"upload_time": "2025-01-26T21:04:41",
"upload_time_iso_8601": "2025-01-26T21:04:41.505377Z",
"url": "https://files.pythonhosted.org/packages/59/13/e02ba5959861b1755e095397c80ef85481d8e6ebfe6cac96829b1911dced/smvp-0.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-26 21:04:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "geozeke",
"github_project": "smvp",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "smvp"
}