How to Send an Email With Attachment From the Command Line
The easiest way is using
mutt -s "Subject" -a /path/to/file -- email@example.com < /dev/null
Multiple attachments are possible as well:
mutt -s "Subject" -a /path/to/file -a /path/to/file -a /path/to/file -- firstname.lastname@example.org < /dev/null
Reader Patrick Hemmen reported an alternative approach using
small MIME encode/decoder.
mpack -s "Subject" /path/to/file email@example.com
The software was last updated in 2003 though and may contain unfixed issues. It can also send only one attachment at a time. Still, it’s good to know about different ways of achieving the same goal.