Hi
I want to use mailx command to send a message included more than one file.
I tried to use uuencode in pipe but it could only generate one file.
I would avoid using an archive file
Thanks to read you.
Mathieu
Hi
I want to use mailx command to send a message included more than one file.
I tried to use uuencode in pipe but it could only generate one file.
I would avoid using an archive file
Thanks to read you.
Mathieu
Try...
( echo "message"
uuencode /path/to/file1 file1
uuencode /path/to/file2 file2
: etc
) | mailx -s "subject" abc@xyz.com
Thanks a lot Igor
I toke your idea to write my solution
You could find it bellow :
SUBJECT=$1
BODY=$2
RECIPIENT=$3
FILE=$4 \#Files to attach \(like /tmp/myfiles_*.txt\)
\(cat $BODY
for i in \`ls -1 $FILE\`
do
file_name=\`basename $i\`
uuencode $i $file_name
done
\) | mailx -s "$SUBJECT" $RECIPIENT
Regards
Mathieu