PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Mail » Mail » Bug #4241

More detailed error for SMTP mail

Details

Request #4241More detailed error for SMTP mail
Submitted2005-04-28 14:47 UTC
Fromamynevada at hotmail dot com
Assignedjon
StatusClosed
PackageMail
PHP Version4.3.11
OSFedora core 2
Roadmaps(Not assigned)

Comments

[2005-04-28 14:47 UTC] amynevada at hotmail dot com

Description:
------------
When i send a Mail and the SMTP server give unrecognized responce, it would be useful to report on Error Message what kind of responce the SMTP server has sended :

For example if the SMTP server sends this message in responce to a $smtp->rcptTo($recipient))) function:

---
Recv: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
---

On the Pear Error it would be useful to know what kind of response SMTP server has sended (In order to debug all problem).

This is the line changed from Mail/smtp.php, Line 198:

foreach ($recipients as $recipient) {
if (PEAR::isError($res = $smtp->rcptTo($recipient))) {
list($code,$message)=$smtp->getresponse();
return PEAR::raiseError('unable to add recipient [' .$recipient . ']: Code:'.$code.' Message:'.$message . "\n".$res->getMessage());
}
}

if (PEAR::isError($smtp->data($text_headers . "\r\n" . $body))) {
list($code,$message)=$smtp->getresponse();
return PEAR::raiseError('unable to send data: Code:'.$code.' Message:'.$message . "\n".$res->getMessage());
}