I've been doing that with a much smaller list, and we periodically run into problems with subscribers SPAM filter, double-propagation of some addresses, etc. I think the days of bcc: are numbered.
The approach we're working on now is to send an URL to subscribers. They click on that and view the newsletter through Flash player.
As for Chris's problem, I don't know. I'd be tempted to have the PHP script pass a set of parameters to a Python script and then end. When the Python script completes have that email the results to the user. A friend of mine used a similar process to handle requests for huge amounts of geological data. The parameters were passed to the database which generated the file and called a script to mail them. The original page was long since gone.
Miles
At 09:56 AM 3/12/2003 -0800, SELPH,JASON (HP-Richardson,ex1) wrote:
You could change the TO: to something generic like "Email List Subscriber" then add everyone to the BCC field and then generate 1 email with 9000 people in the BCC field. Let sendmail do the rest. It should take less time to send the emails and only a few seconds to generate your page.
Cheers Jason
-----Original Message----- From: Chris Payne [mailto:cjp@planetoxygene.com] Sent: Wednesday, March 12, 2003 11:41 AM To: php-db@lists.php.net Subject: newsletter optimization help needed
Hi there Everyone,
Below is some code I use to send a newsletter to clients subscribed on my mailing list. The problem is I have over 9000+ email addresses in the DB and it takes around 30-45 minutes to send them with the below code.
Can anyone see someway I can optimize it so it sends out the newsletter any faster? I've probably gone about this system the long way, but it works - I just need to find a way to make it faster :-(
Thanks everyone
All the best
Chris
---
<?
$connection = mysql_connect("localhost","Username","Password") or die("Couldn't make a connection.");
$db = mysql_select_db("WhateverDB", $connection) or die("Couldn't select database.");
$sql = "SELECT * FROM emailtest";
$sql_result = mysql_query($sql,$connection) or die("Couldn't execute query.");
while ($row = mysql_fetch_array($sql_result)) { $emailadd = $row["EMail"]; $emailname = $row["emailname"]; $emailphone = $row["emailphone"]; $emailaddress = $row["emailaddress"];
$MP = "sendmail -t"; $HT = "<html><body>"; $HT = "</body></html>"; $subject = "$subject"; $NOTE = "$emailtests";
$NOTE = str_replace("*email*", "$emailadd", $NOTE); $NOTE = str_replace("*name*", "$emailname", $NOTE); $NOTE = str_replace("*phone*", "$emailphone", $NOTE); $NOTE = str_replace("*address*", "$emailaddress", $NOTE);
$TO = "$emailadd"; $fd = popen($MP,"w"); fputs($fd,"MIME-Version: 1.0\r\n"); fputs($fd,"Content-type: text/html; charset=iso-8859-1\r\n"); fputs($fd, "To: $TO\n"); fputs($fd, "From: sales@me.com\n"); fputs($fd, "Subject: $subject\n"); fputs($fd, "X-Mailer: PHP3\n"); fputs($fd, "Email: $email\n"); fputs($fd, "$HT"); fputs($fd, "$NOTE"); fputs($fd, "$EHT");
}
pclose($fd); exit;
mysql_free_result($sql_result); mysql_close($connection); ?>
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php