- Install mutt
$ brew install mutt
- Install msmtp
$ brew install msmtp
- Generate gmail application password
# ~/.muttrc
set sendmail=/usr/local/bin/msmtp
# ~/.msmtprc
defaults
auth on
tls on
logfile ~/.msmtp.log
tls_certcheck off
# Gmail
account gmail
host smtp.gmail.com
port 587
from youracc@gmail.com
user youracc
password apppassword
# Set a default account
account default : gmail
# ~/.config/fish/config.fish
function send_to_kindle
echo mobi | mutt -s mobi -a "$argv[1]" -- yourkindle@kindle.com
end
$ send_to_kindle ebook.mobi