I need to mail all users on my shared hosting platform. I need to be able to do this on a regular basis. Any thoughts?
1 Answer
Maybe something like:
echo "message" | mailx -s "notify" `grep -v '#' /etc/passwd | cut -d : -f 1 | sed 's/\(.*\)/&@localhost/' | tr '\n' ' '`
Mails message
with subject notify
to all local users in the system. You can add this to cron(1)
and use different mail addresses from a file:
echo "message" | mailx -s "notify" `cat emaillist.txt`