Req #21165 [Opn->Ana]: Improve mail() error handling

From: Date: Mon, 23 Oct 2017 01:13:44 +0000
Subject: Req #21165 [Opn->Ana]: Improve mail() error handling
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-211847@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=21165&edit=1 ID: 21165 Updated by: kalle@php.net Reported by: tit dot petric at telemach dot net Summary: Improve mail() error handling -Status: Open +Status: Analyzed Type: Feature/Change Request Package: Mail related Operating System: * PHP Version: * Block user comment: N Private report: N New Comment: I think this for one, could be handy or at least to improve mail() in general to not only include more detailed errors but also a proper API for things like attachments Previous Comments: ------------------------------------------------------------------------ [2015-08-25 13:43:53] cmb@php.net Related To: Bug #41330 ------------------------------------------------------------------------ [2002-12-23 05:42:02] tit dot petric at telemach dot net mail is probably the most common used function with the worst set of error reporting available to it mail() returns true on success and false on error, but this "false" is all you can get with php, when as you have to examine the mailer logs to see if the message acctually failed (i for example get false on the mail() function, but the email is queued and sent with sendmail) there should be atleast somekind of trigger_error() sequence which would spew out a few E_NOTICE or E_WARNING triggers depending on the progress of mail() - for example.. if the sendmail_path directive isn't configured properly, some incorrect data (any of the parameters beeing null, empty or not set), or you cant connect to the mail server (windows - only guessing that it doesnt report that), or whatever kind of message the mailer spews out resulting in true/false any kind of verbosity, even if only trough E_NOTICE or E_WARNING would really be appreciated, a simple true or false is just not enough when tracking down why mail() returns false. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=21165&edit=1

« previous php.bugs (#211847) next »