Link to home
Start Free TrialLog in
Avatar of dhite99
dhite99

asked on

Sending a File as an Attachment in Linux Environment

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
Avatar of Peter Hart
Peter Hart
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of dhite99
dhite99

ASKER

Thanks for  the reply, but no php is involved. Essentially I need to send a file as an attachment from within a korn script.
ASKER CERTIFIED SOLUTION
Avatar of bboopathi
bboopathi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dhite99

ASKER

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.