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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.co m < /tmp/mailmessage.txt
do a "man mutt" for all options.
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.co
do a "man mutt" for all options.
more details here:
http://www.howtoforge.com/sending_email_from_php