Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.0

Bug #584 Mail::mail fails on PHP 4.2.2
Submitted: 2004-01-15 13:52 UTC
From: eln at gmx dot net Assigned: jon
Status: Closed Package: Mail
PHP Version: Irrelevant OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 42 + 14 = ?

 
 [2004-01-15 13:52 UTC] eln at gmx dot net
Description: ------------ Using Mail with "mail" fails when using PHP 4.2.2 because of the last parameter to mail(). (As far as I have understood, you support PHP 4.2.2 even thought it's not listed in the box above.) In addition, it's returning a boolean instead of PEAR::Error as the manual says it should do. It is simple to fix: If the last parameter is empty, simply do not use it at all. You can find a patch here: http://ununique.net/div/mail.php.diff It checks if there is any $params and if there isn't, do not use the last parameter. It also fixes the problem with returning false instead of PEAR::Error on failure. Note that this is a possible BC - if people rely on it returning false instead of PEAR::Error, the code will not work as expected. Safe mode is turned off. Reproduce code: --------------- // Using PHP 4.2.2 $pmail =& Mail::factory("mail"); $mailres = $pmail->send($address, $message["headers"], $message["body"]); Expected result: ---------------- $mailres should be true Actual result: -------------- $mailres is false because mail() fails with the 5th parameter.

Comments

 [2004-01-19 08:28 UTC] jon
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.