Page 1 of 1

bulk mail / newsletter management

Posted: Thu Mar 25, 2010 5:54 am
by lupusyon
Hello everybody. I'm building a website for friend who runs a small cinema. Until now he had a static (and pretty ugly, both in gfx and code) website and he's been running a mailing list of people, adding email addresses on (verbal) request to his outlook express address book and sending them his weekly scheduling, all by hand (ugh!). I've already exported his address book in csv format and imported it in a mysql table, removing unused fields and adding some new ones as usernames and passwords (the new site will allow registered newsletter users to log in and write something about movies they've seen); since all that data is already conveniently stored in the site's db, and since, from now on, people will subscribe the newsletter through the site (I've already made the subscription/mail confirmation functions and they work like a charm), I was planning to let my friend manage his newsletter from a reserved area on the site, by composing it through a rich text editor and sending it to the whole list with a single click. That's the issue: I don't know how to write a function or a class capable of handling 2000+ email addresses without timing out. Using set_time_limit(0) seems both unelegant and unreliable to me, probably putting too much strain on the server, not to mention the risk that my friend closes his browser for any reason and ends up with his newsletter sent to half his list without knowing which half. Could anybody give me some advice? Keep in mind that:

- I've already searched the web, resourceindex and other repositories for ready code, but so far I've only found complete solutions with their own web interface, most of which are far too complex for my purpose. Besides, almost all of them didn't support mysql for the mailing list, relying on a text file instead;

- I need support for HTML mail; I've been using "htmlmimemail" for some time now on other projects, and I loved it... but it has the same issues with bulk mailing;

- the web space is hosted, so I can't run stuff like majordomo or mailman on the server;

- the web server is linux-based and runs sendmail. the documentation of the aforementioned "htmlmimemail" script said that one could queue multiple mails in sendmail through the "usequeue" boolean, thus allowing the script to complete its execution without having to wait for the e-mails to be actually sent. could this be the right approach? I made a simple while iteration to send 50 mails instead of one through htmlmimemail, with usequeue=true, but it took it 10 seconds, i.e. the same time it would take with the boolean set to false.

Thanks in advance to anybody who will try to shed some light on my darkest night :banghead:

Re: bulk mail / newsletter management

Posted: Thu Mar 25, 2010 4:35 pm
by Christopher
Take a look at SwiftMailer. It has features that will help you send bulk email.