You must have mutt installed
Use mutt command as follows to send an email with attachment:
$ mutt -s "Test mail" -a /tmp/file.tar.gz email@example.com < /tmp/mailmessage.txt
- firstname.lastname@example.org - is the recipient
- /tmp/mailmessage.txt - is the main body of the e-mail (read message from the file "mailmessage.txt")
- /tmp/file.tar.gz - is an attachment (with option -a)
- "Test mail" - is a subject line (option -s)
Another way is to use uuencode and mail ... but uuencode takes more time .