How do I send an email with attachment from commandline?

Well this is easy with mutt, so first we install mutt:

aptitude install mutt

After that we run the following command:

echo "message body" | mutt -a "/path/to/file.jpg" -s "subject" -- recipient@example.com

You cannot comment on this entry