The current /includes/functions_messenger.php logging for PHP mail() failure currently looks similar to:
Which is "accurate" for what as failed in a technical sense, but not for the phpBB operator who needs to understand what has been affected. With the phpBB SMTP code we have an elaborate and helpful trace of the entire conversation, and if we made it that far, even the subject line and recipient of the email attempting to be sent.
Suggest that we improve the PHP mail() logging, or maybe even all of the email failure logging, to ensure that "what was the subject line of the message" (i.e. has a topic notification failed, has an administrator notification failed, has a personal email request failed, etc., which also confirms which template content would have been used) and "to whom was the message being sent" (which might relate to the failure, but at least imparts knowledge of whom hasn't received their email as intended) is always included in the error log.
Even though we're unable to log "what went on inside the PHP mail() function itself", we could still be more helpful to the phpBB administrator who is looking at their error log after the fact and needing to determine what is failing.
Bonus points for define DEBUG causing us to log the actual headers and data generated for the email, even in the PHP mail() case.