02-23-2004 11:49 AM
I do have a very flexible script that does it with sendmail.
Owner of ISN Corporation
02-23-2004 12:08 PM
$ for e in `echo file1 file2 file3`
uuencode $e $e.txt
done | mailx -m -s "mymail" firstname.lastname@example.org
Make sure that you use the correct suffix for the file being used.
02-23-2004 05:45 PM
02-23-2004 05:53 PM
-Karthik S S
02-23-2004 09:40 PM
You can also do it within a script that also sends some output of other commands in between, like backup commands etc:
echo "start of email, with attaching a text file\n"
ux2dos textfile1.txt | uuencode textfile1.txt
echo "\n start of some command"
echo "now send binary file\n"
uuencode binaryfile1.bin binaryfile1.bin
echo "\n end of email, blabla...."
}| mailx -m -s "mymail" email@example.com
02-24-2004 01:16 AM
Mpack and munpack are utilities for encoding
and decoding (respectively) binary files in
MIME (Multipurpose Internet Mail Extensions)
format mail messages.
02-24-2004 02:08 AM
mailx is a messaging/broadcasting utility. Not a true emailing utility like elm or sendmail. With that said....
There a few ways to do this...
uuencode is one, but if your using this for clients you could run into issues of decoding it.
Then there is a third party software you could use like mpack. Can't comment on this, but folks on the Forums have used it.
My personal favorite is to use the include statement. It's quick & easy and great for scripting with..In other words you have a file, can be any kind, even an Excel spreadsheet on your UNIX box. You simply create dummy include file (I'll call it include.file) with the following information to point to the file to be attached:
or maybe for a simple text file:
and from your command line:
elm -s "This is a test" firstname.lastname@example.org < include.file
To see more examples of this subject just do a search and browse and enjoy...