----- Original Message ----
> From: Brian Hazelton <bdh_2...@comcast.net>
> To: php-general@lists.php.net
> Sent: Fri, October 16, 2009 10:41:03 PM
> Subject: [PHP] PHP broadcast mailer
> 
> I am in charge of an email newsletter list and making sure it gets sent out 
> in 
> time. My problem is I have never done broadcast emailing and right now we 
> have 
> 400 subscribers but want to build a system that can scale well regardless of 
> the 
> number of subscribers. Right now I use mysql to store the email and use 
> phpmailer in a loop to send an email to each of the emails in the db, it is 
> already slow with just 400(takes around 10 min (i think that's slow isnt 
> it?). 
> Has anyone built a broadcast email script and willing to help me?
> 
> -- PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Brian,

Sounds like you're sending 1 email address at the time.  I haven't build any 
yet but here some ideas.  If the subscribers are getting the exact same 
material, you could do batch fetch of several say 20 or more of email address 
(check with your SMTP server limit) and send them all via BCC.  You could knock 
that out easily.  If only some subscribers get the same content, you can then 
fetch the batch email addresses by filtering the content they're supposed to 
receive.

The speed at which your email goes out depends on the SMTP server (delay, 
queue, hardware, attachment size, etc).  Here's a pseudo code:

// fetch email addresses in batch size - within limit of SMTP server
// create email with addresses in BCC - loop through batch to create BCC
// send mail.
// update db for the sent addresses
// rinse and repeat until all emails are sent.

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to