Click to See Complete Forum and Search --> : How to send an email to all users?


Landruu
07-16-2001, 01:46 PM
How do I send an email to all users? I have an email server setup on a RH6.2 box using sendmail (ya I know, switch to Exim). Do I have to set something up first or is there something like mailto:all@mydomain.com?

Keep in mind that I am new at the email thang ;)

Landrew

[ 16 July 2001: Message edited by: Landruu ]

Strike
07-16-2001, 04:21 PM
A simple Perl or shell script could do it. The pseudocode would be:


for all the lines in /etc/passwd;
read in a line
extract the username (split() in Perl, using ':' as the separator would do it I think)
use the "mail" command to send a mail to this user


OR, you can create an alias named something like 'all-users' in /etc/aliases and then just send one mail to all-users.