You should be able to use something like the following example to get the CC option working with mailx. Preferably create a list of users needed to be put in the CC option (as mailCClist.txt in the example). Hope this helps.
Code
SUBJECT="Email Subject Line"
TO=xyz@company.com
CC=`tr '
' ', ' < mailCClist.txt`
#BCC="xyz2@comp.com"
echo "Send the E-mail message..."
/usr/bin/mailx -s "${SUBJECT}" ${TO} <<-END
~< ! uuencode $DCdir/$FileName "Result.txt"
~c ${CC}
~b ${BCC}
Hi,
Blah, Blah.. body of the email.
Thanks
Satya
~.
END
echo "Mail Sent!!"
Login to rate this answer.
Mitra
Answered On : Nov 24th, 2011
Code
uuencode attachment1 attachment1 | mailx -c x@yz.com,a@bc.com -s "subject" m@no.com
Login to rate this answer.