How to attach a file using mail command on Linux? [duplicate] How to attach a file using mail command on Linux? [duplicate] shell shell

How to attach a file using mail command on Linux? [duplicate]


Example using uuencode:

uuencode surfing.jpeg surfing.jpeg | mail sylvia@home.com

and reference article:

http://www.shelldorado.com/articles/mailattachments.html

Note:

you may apt install sharutils to have uuencode command


mail on every version of modern Linux that I've tried can do it. No need for other software:

matiu@matiu-laptop:~$ mail -a doc.jpg someone@somewhere.comSubject: testingThis is a testEOT

ctrl+d when you're done typing.


$ echo | mutt -a syslogs.tar.gz admin@domain.org

But it uses mutt, not mail (or mailx).