Send Email from Terminal with file attachment using mutt

Sometimes I run into situation where I need to email a file, and I am lazy to open a browser, login to my email account, and then attach file and send it.

If you are like me, then mutt is a neat command for sending emails from terminal quickly =P.

The code looks like below:

echo "email body" | mutt -s "email subject" -a "file-to-be-attached"

So, if I need to email a file (in the same directory), I would use the following:

echo "Code for Project" | mutt -s "project c" -a ""

Check out man mutt for more information. Hope it helps out.