Home » Mail » Mail » Bug #9945
Mail not compatible with stable release of Net_SMTP stable
Details
| Submitted | 2007-01-25 17:27 UTC |
|---|---|
| From | tms at infamous dot net |
| Status | Bogus |
| Package | |
| PHP Version | 4.3.2 |
| OS | RHEL ES Release 3 |
| Roadmaps | (Not assigned) |
Comments
[2007-01-25 17:27 UTC] tms at infamous dot net
Description:
------------
Quick summary: /usr/share/pear/Mail/smtp.php calls getResponse() on a Net_SMTP object (line 338).
However, the stable version of Net_SMTP (1.2.8) does not include this method:
http://cvs.php.net/viewvc.cgi/pear/Net_SMTP/SMTP.php?revision=1.28&view=markup
All goes ok until an SMTP problem occurs, then a fatal error results:
Fatal error: Call to undefined function: getresponse() in /usr/share/pear/Mail/smtp.php on line 338
I don't know if the appropriate action is a fix for Mail/smtp.php, or a packaging adjustment to set the proper dependencies. But the current situation makes for a nasty surprise...
Test script:
---------------
<?php
require_once 'Mail.php';
define('SMTP_HOST', 'www.trocadero.com'); // use your own!
$mail =& Mail::factory('smtp',array ('host' => SMTP_HOST));
if (PEAR::isError($mail)) {
echo '<p>Unable to connect to smtp server.';
}
echo "<p>created mailer instance";
$addrs=array('tms@infamous.net','bogus');
foreach ($addrs as $to) {
$hdrs = array('From' => 'tms@trocadero.com', 'Subject' => 'test message',
'To' => $to);
if (!$mail->send($to, $hdrs, "This is a test e-mail message.")) {
echo "<p>Unable to send e-mail: ".
$mail->getMessage().' '.$mail->toString();
}
echo "<p>sent mail to $to";
}
?>
Expected result:
----------------
I expect Mail::send to return an error when it encounters the bogus address.
I expect that Mail 1.1.14 would have appropriate dependencies to require a version of Net_SMTP that won't cause a fatal error.
Actual result:
--------------
Fatal error: Call to undefined function: getresponse() in /usr/share/pear/Mail/smtp.php on line 338
[2007-01-25 17:34 UTC] tms at infamous dot net
May have had a PEAR config problem on our end. Investigating and will re-file if bug is real.