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: [EMAIL PROTECTED]"; 
$sql="SELECT email FROM list ORDER BY email ASC"; 
if ($res=pg_exec($dbconn, $sql)) 
 while ([EMAIL PROTECTED]($res)) 
  { 
  echo $row['email']."<BR>\n"; 
  mail($row['email'], 'Mailing List News', $msg, $header); 
  } 
?>

Expected result:
----------------
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
... 10,000 times. 

Actual result:
--------------
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED] 
... 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

Reply via email to