I'm using alexkowalski script from Email using shell scriptMAILADDR=(mail1@example.com, mail2@example.com, mail3@example.com)for i in ${MAILADDR[@]}    do         echo Mail test... | mail -s Mail test subject... $i    doneMy question is how to read MAILADDR array from an external flat file? And how to insert an external flat file replacing the body of the email as in       echo/home/user/information-for-any-user.txt  | mail -s Mail test subject... $i ??
Email using shell script using email address from external flat file
shell script;email
If the external flat file from which the email addresses are taken from doesn't look too funny (is well formatted), you could use something like that :mail -s My subject $(cat /this/is/the/external/flat/file.txt) < /home/user/information-for-any-user.txt