need to send mail to recipients store in file

September 27, 2011 at 03:24:06
Specs: AIX
how to send mail to recipients stored in file

using below command

cat ${OP}| mail -s "Vault Response Alert:THIS IS TEST ONLY- DO NOT PANIC as test locked / responding slow since ($y EDT)" 'cat adm'

adm is file in the directory of script which hold the email ids separated by comma


See More: need to send mail to recipients store in file

Report •

#1
September 27, 2011 at 07:36:44
Assuming that file adm contains the mail addresses, 1 per line:

# UNTESTED
while read address
do
    mail -s "mail test" $address < ${OP}
done < adm


Report •

#2
September 27, 2011 at 07:46:27
Thanks Nails...

I tried the following way and it worked !!!

cat ${OP}| mail -s "appears to be locked / responding
slow since ($y EDT)" $(cat /tmp/adm)

Now I can add recipients to file separated with , in single line.


Report •
Related Solutions


Ask Question