[lug] Sending Email To Multiple Recipients

Peter Hutnick peter-lists at hutnick.com
Sun Sep 21 16:55:20 MDT 2003

SoloCDM said:

> I'm not sure a mailing list manager like Mailman, Majordomo,
> and many others is the proper avenue.  I always think of them
> as two-way and I am only trying to go one direction.  I want the
> program to email all the recipients, but only have the sender's
> and recipient's email addresses in the headers for "From:" and "To:".

Mailman is suited for this just fine.  You can do an "announcement" type
list that only allows the admin to post.  Don't set up a public archive
and you're golden.

> Sendmail isn't a solution.  When I use an alias to send email
> messages, the name of the alias userslist below remains as the name that
> the recipient receives.
>    userslist: ":include:/etc/mail/userslist"
> The program also needs to allow files to be attached, if it becomes
> necessary.

Perl has a pretty good SMTP module.  I set up a web form that input to a
perl CGI that did a separate SMTP session for each recipient (read from a
file local to the webserver).  This was at an ISP that needed to do
announcements from time to time with paranoid control over exposure of the
recipients list.  I maintained the subscriber list on the server and the
(non-technical) customer service person could fire off messages without
bugging me.

Not sure what would be involved to add attachments.  Shouldn't be too
tough, though.

Surely there is something equivalent in Python if that's your bag.  Or you
could just use C if you are into pain ;-)

Honestly, if I knew then what I know now I would have just used Mailman. 
But that was back around the turn of the century.

OTOH, the perl route is eminently scriptable.  For instance you could
stick the message in one file, the attachment in another and just run the
script and walk away.

Also note that this is an unkind thing to do to an SMTP server, and if it
isn't yours doing so is probably a violation of your AUP, even if the mail
/is/ solicited.


More information about the LUG mailing list