Linux bash: pipe output to an email address as attachment

on ubuntu 11.10

sudo apt-get install mailutils
sudo apt-get install sharutils
Install mailutils as a local server, it will send the mail as <whoami>@<hostname>

To send the manual of mysqldump to my kindle (amazon will convert and deliver for me, of cours add the sender to the allowed addresses here )

man mysqldump | uuencode attach.txt | mail -s “subjectmykindlemail@free.kindle.com