procmail
[Top] [All Lists]

Re: Mailing to all users

1998-07-16 10:33:15
        Author: Administrator <wwwteam(_at_)sansua(_dot_)upb(_dot_)edu(_dot_)co>
        Date:   Thu, 16 Jul 1998 09:34:36 -0500 (EST)
        ID:     
<Pine(_dot_)LNX(_dot_)3(_dot_)93(_dot_)980716092959(_dot_)14064A-100000(_at_)sansua(_dot_)upb(_dot_)edu(_dot_)co>

How can I use procmail to send a message to all users ?

I have a file with the list of users and another with the message.

You don't need procmail for this:

Assuming your list of names is like this (ie /tmp/list)

jim
joe
betty

and your message is in an ascii file (ie /tmp/message)

all you would need is this:

#!/bin/sh

USERS=/tmp/list

MESSAGE=/tmp/message

for i in `cat $USERS`
do

        Mail -s "Your Subject Line Here" $i < $MESSAGE
        
done


However, it would be much more efficient to not call sendmail all those  
times, just make it one long line:

Mail -s "Your Subject Line Here" `cat /tmp/list` < /tmp/message

TjL

        

<Prev in Thread] Current Thread [Next in Thread>