How do I send email attachments from a command prompt?
**Required Software** To do this, I’ll just install Mutt on my Ubuntu/Debian machine.
apt-get install mutt
Here’s a very small example of an email string with an attachment. Then, I’ll provide an explanation of each option.
mutt -s "Test mail" -a /home/data/general_report_11062008.txt your_user@gmail.com < /tmp/mailmessage.txt
Where, 1. your_user@gmail.com – is the recipient 2. /tmp/mailmessage.txt – is the main body of the e-mail (read message from the file “mailmessage.txt”) 3. /home/data/general_report_11062008.txt – is an attachment (with option -a) 4. “Test mail” – is a subject line (option -s)