Sending a File as an Attachment in Linux Environment

dhite99
dhite99 used Ask the Experts™
on
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.

Thanks
Comment
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:
http://www.howtoforge.com/sending_email_from_php

Author

Commented:
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.

http://www.filewatcher.com/m/uuencode-1.0.tar.gz.27331.0.0.html
 
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" mailid@server.com
There is a free perl email program available that you can use.  It has many useful options including relaying through an smtp server.

http://caspian.dotconf.net/menu/Software/SendEmail/

Author

Commented:
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 < "."

Where,
 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.

 Example:
$ mutt -s "Test mail" -a /tmp/file.tar.gz -a /tmp/test.out some.email@some.address.com < /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