E-mail an attachment from linux cli
2009.09.29 - posted in LinuxHere’s something I occasionally use on linux PBX’s:
cat body.txt | mutt user{a}example.com -a example.txt -s “Yoursubject”
Where:
- body.txt contains the message body
- user{a}example.com is the recipient e-mail address
- example.txt is file to attach
- Yoursubject is the subject of the message
It requires mutt to be installed, but this is often the case, even on servers with a minimal install.
.EOF.