CLI tool to send ebooks to Kindle via email
- Python 100%
SEND2KINDLE_FROM and SEND2KINDLE_TO replace hardcoded email addresses. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| README.md | ||
| send2kindle.py | ||
send2kindle
A minimal CLI tool to send an ebook file to a Kindle email address via Gmail.
Requirements
- Python 3
- A Gmail account with a Gmail App Password (requires 2-Step Verification)
Setup
Export the following environment variables (add to ~/.zshrc or ~/.bashrc):
export GMAIL_APP_PASSWORD="xxxx xxxx xxxx xxxx"
export SEND2KINDLE_FROM="you@gmail.com"
export SEND2KINDLE_TO="you_xxx@kindle.com"
Optionally, symlink the script so you can call it as send2kindle from anywhere:
ln -s /path/to/send2kindle.py /usr/local/bin/send2kindle
Usage
send2kindle path/to/book.epub
The ebook is sent as an attachment to your Kindle email address. The subject is set to the filename, which is the format Amazon's email-to-Kindle service expects.
Configuration
All configuration is via environment variables:
| Variable | Purpose |
|---|---|
GMAIL_APP_PASSWORD |
Gmail App Password for SMTP authentication |
SEND2KINDLE_FROM |
Sender address (your Gmail address) |
SEND2KINDLE_TO |
Recipient address (your Kindle email address) |