[wp-trac] [WordPress Trac] #23291: wp_mail should handle phpmailer exceptions instead of ignoring them

WordPress Trac noreply at wordpress.org
Mon Sep 16 22:07:36 UTC 2013


#23291: wp_mail should handle phpmailer exceptions instead of ignoring them
---------------------------------+------------------
 Reporter:  mark-k               |       Owner:
     Type:  enhancement          |      Status:  new
 Priority:  normal               |   Milestone:  3.7
Component:  Mail                 |     Version:  3.5
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 3.7-early  |
---------------------------------+------------------

Comment (by nacin):

 I'm not sure I understand why wp-login.php underwent some logic changes.
 When $message is empty, nothing happened previously; now, an error is
 shown. Also, the text "Possible reason: your host may have disabled the
 mail() function." vanished. I am going to take a wild guess that the
 string for PHPMailer's exception is crappier, written "by developers for
 developers", and untranslated. I don't actually know if WP_Error is useful
 here — if wp_mail() failed, for any reason, we should just tell them.

 Rather than `if ( $wp_error == true )`, `if ( $wp_error )`. Rather than
 `count( $errors->get_error_codes() ) > 0`, just do
 `$errors->get_error_code()`.

 We should consider passing the failed address/attachment/etc. as data to
 WP_Error:add() (third argument).

--
Ticket URL: <http://core.trac.wordpress.org/ticket/23291#comment:39>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list