# uuencode mailx - send multiple emails

**URL:** <https://community.unix.com/t/uuencode-mailx-send-multiple-emails/242374>\
**Category:** Shell Programming and Scripting\
**Created:** [June 12, 2009, 7:03am UTC](https://community.unix.com/t/uuencode-mailx-send-multiple-emails/242374 "2009-06-12T07:03:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![suthera](https://community.unix.com/letter_avatar/suthera/32/6_449c533f586939b6e5f246632a46421f.png) [@suthera](https://community.unix.com/u/suthera)\
**Post date:** [June 12, 2009, 7:03am UTC](https://community.unix.com/t/uuencode-mailx-send-multiple-emails/242374/1 "2009-06-12T07:03:14Z")

</div>

The following is an extract from one of my Shell Scripts which uses uuencode and mailx to send an email with multiple attachements:

uuencode $LOG\_REPORT $(basename $LOG\_REPORT)  
uuencode $HTML\_FILE $(basename $HTML\_FILE )  
) | if [$ENV = 1]  
then mailx -b "$COPY\_TO" -s "$SUBJECT" -r "$MAIL\_FROM" "$MAIL\_TO"  
else mailx -s "$SUBJECT" -r "$MAIL\_FROM" "$MAIL\_TO\_TEST"  
fi

However I need to send another (separate) email from within the same shell script also using uuencode and mailx. Does anyone know if this is possible? If I duplicate the above syntax it still only sends one email ...

---

<div class="post-metadata">

**Author:** ![clx](https://community.unix.com/letter_avatar/clx/32/6_449c533f586939b6e5f246632a46421f.png) [@clx](https://community.unix.com/u/clx)\
**Post date:** [June 12, 2009, 8:15am UTC](https://community.unix.com/t/uuencode-mailx-send-multiple-emails/242374/2 "2009-06-12T08:15:31Z")

</div>

if you want to send another email.. then you must have some value differ..  
either subject or content or recipients.. if everything is same and you just want to add the recipients.. just modify your "$MAIL\_TO" and/or "$MAIL\_TO\_TEST"

---

<div class="post-metadata">

**Author:** ![suthera](https://community.unix.com/letter_avatar/suthera/32/6_449c533f586939b6e5f246632a46421f.png) [@suthera](https://community.unix.com/u/suthera)\
**Post date:** [June 16, 2009, 8:36am UTC](https://community.unix.com/t/uuencode-mailx-send-multiple-emails/242374/3 "2009-06-16T08:36:17Z")

</div>

Thanks anchal\_khare

I modified the email subject on the second emailing code and it worked.
