Email ebooks to kindle from the command line

There are various ways to send an ebook to a kindle, I use a tiny script. The only tricky part is to set the correct content type. You can get your kindle email address from your devices list on amazon.

Raw
#!/usr/bin/env bash

MAIL="<your address>@kindle.com"

while [ -n "$1" ]; do
        if [ -z "$1" ]; then
                echo "Submit file to kindle"
                echo "Usage: kinde.sh <ebook>"
                exit 1
        fi


        echo "Sending $1 to ${MAIL}"
        echo "$1" | mail --content-type "application/x-mobipocket-ebook" --attach "$1" --subject "$1" "${MAIL}"
        shift
done

0 comments

Start a new thread

Cancel reply