Sending emails to a large group

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have written a script to send an email to a large list of emails, it
works fine except for one slightly major thing. Each email needs to have
the receipient's email address at the bottom of the message for removal
purposes. This requires crafting a seperate email for each person. And
therefore I must send an individual email for each person. The problem
is rate. I need to know how I can rate limit the outgoing messages,
and/or make my mta (exim) send lots of messages in one connection (up to
50 per connection). Any help is much appreciated.


Re: Sending emails to a large group


Quoted text here. Click to load it

I am not sure whether this is an acceptable solution, but since apparently
you put an HTML URL as a removal link, why don't you go all the way and do
the removal via a "mailto:" link instead of a "http://" one??

Such as:

Then you'd simply remove (possibly, sending a confirmation email) whatever
email address the mail to remove_me happened to come from.

This way, all the emails become identical and you can send them via BCC in
batches - you might also send them with fsockopen to the relevant MTA's. I
know there are PHP classes that do just that.

Leonardo and his .015 EUR
:From: "Guglielmo Maria Euge Rinaldini" <guglielmo.rinaldini(at)>
:Provate a guardare gli ingredienti del famoso Labello che si usa per
:le labbra screpolate: Butirrospermum Parkii (sperma di maiale).

Re: Sending emails to a large group

David Wahl wrote:
Quoted text here. Click to load it

IMHO, PHP is not good for this purpose. You may want to buy some
bulkmailers. If the numbers are only thousands, you may try
queuing--some PHP codes *were* available for that, IIRC.

<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com    Blog: /

Re: Sending emails to a large group


David Wahl wrote:
Quoted text here. Click to load it

Since you need to personalize the messages, you need to send separate
messages to each user. It is also recommended that you tell exim to just
queue the messages a deliver them next time the queue is run so your PHP
script does not have to wait for each delivery.

You may want to take at a look at this class that comes with special
support for bulk mailing of personalized messages. It has the
SetBulkMail function that hints the class to optimize itself for that

The personalization of the messages is done just by replacing the parts
of the message that you want to change. You can also use Smarty as
template engine for defining your message bodies.

It also has a sub-class specialized on deliverying sendmail that is
compatible with exim that has options to tell it to just queue the
messages deferring delivery for next queue run.


Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP /

PHP Reviews - Reviews of PHP books and other products /

Metastorage - Data object relational mapping layer generator

Site Timeline