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.
Don't forget to whitelist your from address in your Amazon settings either, or else it will never reach your device.
#!/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
Reply