|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-06-29 18:05 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 13:00:01 2025 UTC |
Description: ------------ When used repeatedly, in a loop, mail() will often hang causing the script and/or browser to timeout. Sometimes the script will continue to execute after the browser times out, causing all sorts of grief. I've tested this on numerous (RedHat 7.x through RH FC1) servers, and have seen the same issue since at least PHP 4.2.x. (Just crossed my mind to report this as a bug!) Reproduce code: --------------- <? set_time_limit(0); $header="From: mlist@domain.com"; $sql="SELECT email FROM list ORDER BY email ASC"; if ($res=pg_exec($dbconn, $sql)) while ($row=@pg_fetch_array($res)) { echo $row['email']."<BR>\n"; mail($row['email'], 'Mailing List News', $msg, $header); } ?> Expected result: ---------------- user@domain.com user@domain.com user@domain.com ... 10,000 times. Actual result: -------------- user@domain.com user@domain.com user@domain.com ... typically less than 100 times, and then browser times out.