[wp-trac] [WordPress Trac] #23642: wp_mail() returns true if sending failed

WordPress Trac noreply at wordpress.org
Mon Mar 4 03:35:43 UTC 2013


#23642: wp_mail() returns true if sending failed
--------------------------+------------------------------
 Reporter:  chmac         |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Mail          |     Version:  3.2
 Severity:  minor         |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by chmac):

 Just to be clear, this is a '''bug''' that was introduced in [17753] in
 response to #17228.

 The documentation on wp_mail reads:
 {{{
      * A true return value does not automatically mean that the user
 received the
      * email successfully. It just only means that the method used was
 able to
      * process the request without any errors.
 }}}
 and:

 {{{
 @return bool Whether the email contents were sent successfully.
 }}}

 The bug was introduced 23 months ago, so has been around for a long while,
 I noticed it but never bothered looking into it. But I think fixing it
 restores backwards compatibility, not breaks it. Folks should expect that
 if wp_mail() returns true, the mail was sent, as the documentation states,
 and as the convention has been for the 3+ years prior to the introduction
 of this bug.

 @iandunn: I noticed because of the test feature in wp-mail-smtp which
 started returning true on failure some 23 months ago. Took me a while to
 figure it out!

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


More information about the wp-trac mailing list