Jan 012011

From the command line enter the following to install uuencode/uudecode on Fedora Linux: yum -y install sharutils

Email a file named datafile.tar.gz:

Type uuencode command as follows:

$ uuencode datafile.tar.gz datafile.tar.gz | mailx -s “My Data File” user@yourcorp.com

The file name “datafile.tar.gz” appears twice on the uuencode command line. There must be two names. The second one is the name of the file when it is decoded.

Email a photo along with a text message:

Type the command as follows;

$ (cat information.txt; uuencode photo.jpg photo.jpg) | mail -s “Subject” user@domain.com

Email multiple attachments in a single email:

Type the command as follows:

$ uuencode r1.tar.gz r1.tar.gz > /tmp/mailfile.out

$ uuencode r2.tar.gz r2.tar.gz >> /tmp/mailfile.out

$ uuencode r3.tar.gz r3.tar.gz >> /tmp/mailfile.out

$ cat email-body.txt >> /tmp/mailfile.out

$ mail -s “Multiple Files” user@domain.com < /tmp/mailfile.out

Here is a function that I created to uue a file then mail it to a recipient. To use it all you have to do is paste this function in your .profile then reload your profile. At the command prompt type: UUE filename.xxx person@example.com

#uue a file then email it.
UUE() {
if [ $# -eq 0 ]
echo Usage: UUE filename.xxx person@example.com
uuencode $1 $1 | mailx -s “$1” $2

To uudecode a file simply type: uudecode filename