[wp-trac] [WordPress Trac] #35598: Use different error code for PHPMailer exceptions in wp_mail_failed

WordPress Trac noreply at wordpress.org
Mon Jan 25 11:00:56 UTC 2016


#35598: Use different error code for PHPMailer exceptions in wp_mail_failed
--------------------------+-----------------------------
 Reporter:  Kau-Boy       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Mail          |    Version:  4.4.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This is a follow-up to #18926.

 I recently had issues with a contact form plugin and while trying to debug
 it, I found the new `wp_mail_failed` hook. It would have been quite handy
 to use, but in it's current implementation, it is quite uselesse.

 It is using a `WP_Error` which is fine. In the `WP_Error` the constructor
 checks the `$code` to be not empty. But as the `PHPMailer` almost always
 use a error code of zero, the `WP_Error` will not provide any useful
 information (it's empty).

 I would recommend to either using `wp_mail_failed` or something similar.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35598>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list