Home » Mail » Mail » Bug #1222
Use of undefined constant PEAR_MAIL_FAILED
Details
| Submitted | 2004-04-16 14:39 UTC |
|---|---|
| From | thierry dot bo at netcourrier dot com |
| Assigned | chagenbu |
| Status | Closed |
| Package | |
| PHP Version | 4.3.2 |
| OS | win32 2K |
| Roadmaps | (Not assigned) |
Comments
[2004-04-16 14:39 UTC] thierry dot bo at netcourrier dot com
Description:
------------
Hi,
using Mail 1.1.3, if I provide a wrong amil adress (just to test),
I get this warning (this one is normal) :
Warning: mail(): SMTP server response: 504 <myadress.com>: Recipient address rejected: need fully-qualified address in c:\Php\PEAR\Mail\mail.php on line 112
but the notice is not normal :
Notice: Use of undefined constant PEAR_MAIL_FAILED - assumed 'PEAR_MAIL_FAILED' in c:\Php\PEAR\Mail\mail.php on line 121
Thierry Bothorel
[2004-04-16 14:56 UTC] thierry dot bo at netcourrier dot com
In fact, even if I have to test email adress or SMTP server, the first warning is annoying because even a well formatted email adress may occurs an error is pop server is down. In this case it breaks my application. The only way I found is to suppress these warnings with @:
if (empty($this->_params) || ini_get('safe_mode')) {
$result = @mail($recipients, $subject, $body, $text_headers);
} else {
$result = @mail($recipients, $subject, $body, $text_headers,
$this->_params);
}
This way $result == FALSE and the code does not break, I can use PEAR::Error messages.