Php/Mysql Mailing List Browser Time Out on Send
[email protected] ("Jak")
| Newsgroups | php.general |
|---|---|
| Message-ID | <00ce01bfc0d6$b419fe80$48024ed4@elena> |
Hello, I've built a simple mailing list for my community of musicians, where each member can have his own...
I've experienced everything works fine to around 50 mails, but then the browser timeout of the page used to send sort of breaks the sending process...
Here is an excerpt of the code I use:
if ($myrow = mysql_fetch_array($result)) {
echo "<div align=\"left\">";
echo $mmsubject;
echo "<br><br>";
echo nl2br($mmessage);
echo "<br>";
echo "</div>";
$memail=$myrow[memail];
$mname=$myrow[mname];
do {
$mmlemail=$myrow[mmlemail];
mail("$mmlemail", "$mname - -=TRIBE=- Mailing List : $mmsubject", $mmessagee, "From: $memailil\nReply-To: $memail\n");
echo "<br>Message sent to ".$mmlemail." - ".$mname."<br>";
} while ($myrow = mysql_fetch_array($result));
mail("[email protected]", "Copy of $mname -=TRIBE=- Personal Mass Mail Message - www.mp3-tribe.com - $mmsubject", $mmessage, "From: $adminemail\nReply-To: $adminemail\n");
}
This code, after getting out the emails from a simple table, sends in a loop the message to the recipients...
Now, the resulting page shows the "Message sent to... " up to a certain extent, and then a timeout incurs....
Solutions?
(not elegant, I might break up sends in groups of 50.. e.g. send first 50, show result, then send next 50, then .... )
I appreciate your help, and if you want to listen to some techno music while coding ... come o'er! :-)
Jak
www.mp3-tribe.com