A simple CLI tool for sending emails with plain text, HTML, and file attachments
Project description
email-cli-tool
A simple CLI tool for sending emails with plain text, HTML, and file attachments.
Features
- Send plain text / HTML / mixed format emails
- Attach multiple files and images
- Multiple recipients support
- Direct SMTP connection (SSL / STARTTLS)
- Interactive configuration wizard
- Read body content from stdin
Installation
# From PyPI
pip install email-cli-tool
# Or with uv
uv tool install email-cli-tool
Quick Start
1. Initialize Configuration
emailcli init
Follow the prompts to enter your SMTP settings. Example for Gmail:
| Field | Value |
|---|---|
| From address | yourname@gmail.com |
| SMTP host | smtp.gmail.com |
| SMTP port | 465 |
| SMTP username | yourname@gmail.com |
| SMTP password | App password |
| Encryption | ssl |
2. Send Emails
# Plain text
emailcli send --to user@example.com --subject "Hello" --body "Hello World"
# HTML format
emailcli send --to user@example.com --subject "Notice" \
--html "<h1>Title</h1><p>Body content</p>"
# With attachments
emailcli send --to user@example.com --subject "Report" \
--body "Please see attachments" \
--attach report.pdf \
--attach photo.png
# Multiple recipients
emailcli send \
--to a@example.com \
--to b@example.com \
--subject "Broadcast" --body "Hello everyone"
# HTML body from file
emailcli send --to user@example.com --subject "Newsletter" \
--html-file template.html
# Read body from stdin
echo "Content" | emailcli send \
--to user@example.com --subject "Piped" --body -
Command Reference
emailcli send
| Option | Required | Repeatable | Description |
|---|---|---|---|
--to |
✅ | ✅ | Recipient email address |
--subject |
✅ | Email subject | |
--body |
Plain text body, - reads from stdin |
||
--html |
HTML body string (mutually exclusive with --html-file) |
||
--html-file |
Read HTML body from file (mutually exclusive with --html) |
||
--attach |
✅ | Attachment file path | |
--from |
Override sender address from config |
At least one of
--body,--html, or--html-fileis required.
emailcli init
Interactively create the configuration file at ~/.emailcli/config.yaml.
emailcli config show
Display current configuration (password is masked).
emailcli skill install
Install the send-email agent skill so Claude Code or Codex can send mail for you.
# Install for both Claude Code and Codex (default)
emailcli skill install
# Only one agent
emailcli skill install --target claude
emailcli skill install --target codex
Writes SKILL.md to ~/.claude/skills/send-email/ and/or ~/.codex/skills/send-email/.
Configuration
Path: ~/.emailcli/config.yaml
from: yourname@gmail.com
smtp:
host: smtp.gmail.com
port: 465
username: yourname@gmail.com
password: your-app-password
encryption: ssl # ssl | starttls | none
Development
# Install dependencies
uv sync
# Run tests
uv run pytest -v
# Run locally
uv run emailcli --help
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file email_cli_tool-0.2.0.tar.gz.
File metadata
- Download URL: email_cli_tool-0.2.0.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c1b8af5bf227162aa06f15a9283ec856bdf5e8808800ac6525b15f9f715dc42
|
|
| MD5 |
3fca352246c00c87f714dc3d7e5b12ff
|
|
| BLAKE2b-256 |
feb03263eea7fbdb6edaa1e86e0ec36a54294a53bd82d154c7351af434172a61
|
Provenance
The following attestation bundles were made for email_cli_tool-0.2.0.tar.gz:
Publisher:
publish.yml on ClaymanTwinkle/email-cli-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
email_cli_tool-0.2.0.tar.gz -
Subject digest:
6c1b8af5bf227162aa06f15a9283ec856bdf5e8808800ac6525b15f9f715dc42 - Sigstore transparency entry: 1779037430
- Sigstore integration time:
-
Permalink:
ClaymanTwinkle/email-cli-tool@021093f37012920d7852db9e7d5acc90d9d9f899 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ClaymanTwinkle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@021093f37012920d7852db9e7d5acc90d9d9f899 -
Trigger Event:
release
-
Statement type:
File details
Details for the file email_cli_tool-0.2.0-py3-none-any.whl.
File metadata
- Download URL: email_cli_tool-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d67aafe9113204a2840037928e5e9a8fa004a37fc24a6799df682d34038490ca
|
|
| MD5 |
86718f721a543b7f31e845227794f04c
|
|
| BLAKE2b-256 |
4172043932a511d69f2445911e06481dedd25623993704b5d72b1979ba9e328e
|
Provenance
The following attestation bundles were made for email_cli_tool-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on ClaymanTwinkle/email-cli-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
email_cli_tool-0.2.0-py3-none-any.whl -
Subject digest:
d67aafe9113204a2840037928e5e9a8fa004a37fc24a6799df682d34038490ca - Sigstore transparency entry: 1779037596
- Sigstore integration time:
-
Permalink:
ClaymanTwinkle/email-cli-tool@021093f37012920d7852db9e7d5acc90d9d9f899 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ClaymanTwinkle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@021093f37012920d7852db9e7d5acc90d9d9f899 -
Trigger Event:
release
-
Statement type: