I need to send an email from linux using mail command. The problem is I can't hardcode the to: emailaddress, The email address is saved in a recipient.lst file on the server in this format:
To: a@b.com
Thanks a lot.
il_labor
I need to send an email from linux using mail command. The problem is I can't hardcode the to: emailaddress, The email address is saved in a recipient.lst file on the server in this format:
To: a@b.com
Thanks a lot.
il_labor
Extract the recipient list from the file using following command:-
cat recipient.lst | grep "To:" | awk -F":" ' { print $2 } '
Use the extracted list to email in a loop.