Sending a File as an Attachment in Linux Environment

dhite99 used Ask the Experts™
Hi - I've read several solutions regarding this topic & they make sense, however here's my predicament - I don't control or manage (SA) the Linux environments and regrettably getting anything added or changed is next to impossible. Also, I've looked for uuencode and MIME; couldn't find any trace of those on these linux boxes so it doesn't appear that is an avenue.  

Is the "metamail" code something that I can just unzip and use in place or is it some kind of Linux/Unix package that must be installed by a sys admin? Is there ANY alternative to send a file as an attachment that is automatically included with linux builds (mailx is present and I can send the contents of the file as the body of the email, but naturally they want it as an attachment.) Mailx does not appear to support sending files. Any help is most appreciated.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
if you use php tpo send email I think you can lso use the built in attachemetns - or am I mis reading you? (I'm a windows head so my linus is limited) - buty even for windows based systems using php email code usually does thetrick...)
more details here:


Thanks for  the reply, but no php is involved. Essentially I need to send a file as an attachment from within a korn script.
Please visit this site for download of uuencode for linux available.
After un-taring, run configure && make; you need not have to install.
Include the directory you unzipped into, to the path variable. You are good to go

use following comman for attaching a file on linux

uuencode filename filename | mail -s "Subject"
There is a free perl email program available that you can use.  It has many useful options including relaying through an smtp server.


I found an additional solution as well - on linux distros there is a utility called "mutt". The syntax for sending a file is as follows:

mutt -s "Subject" -a attachment -a attachment to_address -b address -c address < "."

 to_address is the recipient
 "." – END of text (main body of the e-mail)
 -s is a subject line  
 -a attach a file to your message
 -b specify a blind-carbon-copy (BCC) recipient
 -c specify a carbon-copy (CC) recipient
 Use "," to send more then one recipient.

$ mutt -s "Test mail" -a /tmp/file.tar.gz -a /tmp/test.out < /tmp/mailmessage.txt

do a "man mutt" for all options.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial