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 : 14 + 1 = ?

 
 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!