labradorchik
asked on
How to include email addresses within a file and then send a message by using that file in the Unix bash shell script?
In the Unix bash script, how can I create a file with some email addresses and then use that file to send messages through Unix bash shell script?
For example, I would like to send my message to: person1@yahoo.com, person2@yahoo.com, and person3@yahoo.com
How above email addresses need to be entered in the file "mailfile.txt" and what would be a command to send "mailfile.txt" in the Unix bash shell script?
I tied to enter email addresses in the "mailfile.txt" the following way:
person1@yahoo.com, person2@yahoo.com, person3@yahoo.com
then I tried to run below sript:
For example, I would like to send my message to: person1@yahoo.com, person2@yahoo.com, and person3@yahoo.com
How above email addresses need to be entered in the file "mailfile.txt" and what would be a command to send "mailfile.txt" in the Unix bash shell script?
I tied to enter email addresses in the "mailfile.txt" the following way:
person1@yahoo.com, person2@yahoo.com, person3@yahoo.com
then I tried to run below sript:
mailSubject="ERROR: Module10 - FAILED, REVIEW Program LOG"
mydir=/year/month/week/day
mymail=$mydir/mailfile.txt
(echo "----------------------------------------------------------------"
echo "Module10 Update Program"
echo "ERR Msg: Module10 failed review program LOG"
echo "----------------------------------------------------------------") | mailx -s $mailSubject $mymail
No errors are produced and no mail has been send to those three recipients.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER