Basically, there is a program for this called "mail". The email subject can be specified using -s and the address list with -t. You can write the text yourself using the echo command:
echo "This will go into the body of the mail." | mail -s "Hello world" you@youremail.com
or get it from other files:
mail -s "Hello world" you@youremailid.com < /home/calvin/application.log
mail does not support sending attachments, but Mutt does:
echo "Sending an attachment." | mutt -a file.zip -s "attachment" target@email.com
Please note that mutt is much more than mail. You can find the best explanation here.
PS: thanks @slhck for pointing out that my previous answer was terrible .;)
BlackBear Jan 11 '11 at 1:51
source share