> > -----Original Message----- > > From: Justin French [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, June 12, 2002 6:45 AM > > To: php > > Subject: [PHP] bulk mail() > > > > > > Hi all, > > > > I've got a mailing on a website, with email address' / names / etc in a > > MySQL table. > > > > I think there's around 120 on it at the moment. > > > > I've been noticing a growing lag on the sending of mail though... > > I've got a > > script which takes a message from a form, then runs a while loop > > through the > > rows of the mailing_list table, replacing a special string with the > > subscribers name, and sending using the mail() command. > >
You're using something like mysql_fetch_array and not querying the db 120 times I hope. > > However, this time, the script actually failed, with a "failure when > > attempting to access blah.com/foo.php" (the sending script). I > > have no idea > > if SOME people got the email, or what, and have no idea how to check.> go through the your MTA's logs (long and painful process) > > So, I make the assumption that as the mailing list has grown, the script > > time has slowed... now it's too big (or the server was too busy) > > to process > > all the emails before the script timed out. The time your MTA takes to process the emails has nothing to do with this. 120 calls to mail() should not time out, maybe you have a complicated regexp for fixing that name in the emails what's the body of your while() loop ? > > > > If I didn't want to personalise the emails, I'm sure the script > > would run a > > lot quicker with every address in the Bcc header, but since we personalise > > each email, I can't see any option other than using mail() 200 > > times... and > > it's only going to get a lot worse as we climb to 1000+. > > putting 120 email addresses in one bcc will surely get your email classified as spam > > So, what options do I have? > > > > Break the mailing list up into batches of 40 or so? How would I implement > > something like this? > > you could try adding a column in your db that will reflect the last time you've sent an email to that person. Then you could just append "LIMIT 40" to your select query, but updating the column requires a separate query (1 update per email if you want to know exactly how got the email and who didn't) Pawel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php