Skip to main content

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 (latest)
pip install email-cli-tool

# Install a specific version
pip install email-cli-tool==0.2.0

# Upgrade an existing install
pip install --upgrade email-cli-tool

# Or with uv
uv tool install email-cli-tool          # latest
uv tool install email-cli-tool==0.2.0   # specific version

The emailcli skill install command requires version 0.2.0 or newer.

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-file is 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

email_cli_tool-0.2.1.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

email_cli_tool-0.2.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file email_cli_tool-0.2.1.tar.gz.

File metadata

  • Download URL: email_cli_tool-0.2.1.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for email_cli_tool-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5d148ce03528b34854abb1722e66d3cbfc09a54326f78062423cf4a57aec500d
MD5 4ea078320eecac5b423572a8ba289470
BLAKE2b-256 f4252ac0519142630ee24cbbccc75052410b0e8f7e40f60c7ff02b01ab19f36d

See more details on using hashes here.

Provenance

The following attestation bundles were made for email_cli_tool-0.2.1.tar.gz:

Publisher: publish.yml on ClaymanTwinkle/email-cli-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file email_cli_tool-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: email_cli_tool-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for email_cli_tool-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0247e201170014b90dab25514226f5f6775e8cd008eeacc5249dcd62077c6d8
MD5 d1ac512410f810bf949ad74449e1b727
BLAKE2b-256 c8af99f0b0723aba9f6925609b02a2b23849fd8772665d3e05aec49a96aa96c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for email_cli_tool-0.2.1-py3-none-any.whl:

Publisher: publish.yml on ClaymanTwinkle/email-cli-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page