Re: PHP broadcast mailer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message ----
> From: Brian Hazelton <bdh_2003@xxxxxxxxxxx>
> To: php-general@xxxxxxxxxxxxx
> Sent: Fri, October 16, 2009 10:41:03 PM
> Subject:  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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux