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
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-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.0.tar.gz (40.6 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.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

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

Hashes for email_cli_tool-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6c1b8af5bf227162aa06f15a9283ec856bdf5e8808800ac6525b15f9f715dc42
MD5 3fca352246c00c87f714dc3d7e5b12ff
BLAKE2b-256 feb03263eea7fbdb6edaa1e86e0ec36a54294a53bd82d154c7351af434172a61

See more details on using hashes here.

Provenance

The following attestation bundles were made for email_cli_tool-0.2.0.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.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

Hashes for email_cli_tool-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d67aafe9113204a2840037928e5e9a8fa004a37fc24a6799df682d34038490ca
MD5 86718f721a543b7f31e845227794f04c
BLAKE2b-256 4172043932a511d69f2445911e06481dedd25623993704b5d72b1979ba9e328e

See more details on using hashes here.

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

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