Sending multiple attachments

Hi people, I am new to this forums. I have a quick question I hope one of you could help me with. I am writing a script to send attachments via email. However I am having trouble when trying to send multiple attachments. Here is the code I am using:

send_mail()
{
uuencode $TMP $TMP1 > $TMP1
uuencode $TMP $TMP3 > $TMP3

cat $MAILGROUP | while read RECIPIENT
        do
           mailx -s "$BROKER" $RECIPIENT < $TMP1 < $TMP3		 
           STATUS=$?
           if [ $STATUS -ne 0 ]
              then
              exit 1
           fi
        done
}

$TMP, $TMP1 and $TMP3 have already been declared and the code works fine for sending emails and attachments, but this code only sends the $TMP3 file as an attachment and does not send $TMP1. I need the script to send both attached files in the same email. Can anyone help me with this?

Your responses are much appreciated.

I am not at a UNIX box, so try this modification