voipmeister.com voip stuff matters and more

E-mail an attachment from linux cli

Here’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.