One solution could be this:

You only need on page for this:

1) create an array of recipients

2) get value from array like array[$pos];

3) send mail to this receiver

4) now some javascript, unless ofcourse if $pos is bigger than
count($array): location.href = "http://blah.com/foo.php?pos=<?=$pos+1?>


And keep some log on sending. Even simple text file will do, if you are
sending mails in some known order. Log file is very handy if cpu
crashes, or something else happens.


Niklas


-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED]] 
Sent: 12. kesäkuuta 2002 14:45
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.

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.

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.


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+.

So, what options do I have?

Break the mailing list up into batches of 40 or so?  How would I
implement something like this?


Any advice / concepts / ideas welcome!


Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------


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

###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###########################################
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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

Reply via email to