[lug] Sending Email To Multiple Recipients

Sean Reifschneider jafo at tummy.com
Mon Sep 22 02:03:43 MDT 2003


On Sat, Sep 20, 2003 at 05:58:57PM -0600, SoloCDM wrote:
>recipients.  An email program like Pine, Netscape, IE, and many
>similar programs force the sender to list all the recipients at
>once so the recipients know everyone who received the message.
>No, BCC is not what I am suggesting.

I've been doing something like that lately to contact a small list of
users.  About 15.  What I do is I save the list of addresses to one
file, save the body I want to send to another file, and then do:

   for addr in `cat /tmp/addrlist`
   do mutt -s 'Subject String' -i /tmp/body "$addr"
   done

That pops me into the editor for each recipient, which is fine for me
for 15 recipients.  If I were doing very many more, I'd make a file that
was a prototype of the message including headers, like:

   From: Sean <jafo at example.com>
   To: @@RCPT@@
   Subject: Whatever
   Date: Whenever

   This is my message

Then do something like:

   for addr in `cat /tmp/addrlist`
   do sed 's/@@RCPT@@/'"$addr"'/' /tmp/message | /usr/sbin/sendmail -t -oi
   done

This isn't super efficient, and should definitely not be used for
sending spam to a million people, but it would work for hundreds to
thousands of recipients just fine.

Sean
-- 
 "We just wanted to give the band a little more thrust than most other bands."
         - Donald Fagen's reply to why they chose the name 'Steely Dan'
Sean Reifschneider, Member of Technical Staff <jafo at tummy.com>
tummy.com, ltd. - Linux Consulting since 1995.  Qmail, Python, SysAdmin



More information about the LUG mailing list