#28914 [NEW]: Mail() hangs when sending large amounts of email
| From: | bens at effortlessis dot com | Date: | Thu, 24 Jun 2004 23:05:22 +0000 |
| Subject: | #28914 [NEW]: Mail() hangs when sending large amounts of email | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-61334@lists.php.net to get a copy of this message | ||
From: bens at effortlessis dot com
Operating system: Red Hat FC1
PHP version: 4.3.7
PHP Bug Type: Mail related
Bug description: Mail() hangs when sending large amounts of email
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.
--
Edit bug report at http://bugs.php.net/?id=28914&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28914&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28914&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28914&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28914&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28914&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28914&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28914&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28914&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28914&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28914&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28914&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28914&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28914&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28914&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28914&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28914&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28914&r=float