[wp-trac] [WordPress Trac] #23243: wp_mail() not working with "Name <email>" format in buggy PHP versions on Windows

WordPress Trac noreply at wordpress.org
Sun Jan 20 15:59:30 UTC 2013


#23243: wp_mail() not working with "Name <email>" format in buggy PHP versions on
Windows
-----------------------------+--------------------------
 Reporter:  bbosh            |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  3.5              |   Severity:  minor
 Keywords:                   |
-----------------------------+--------------------------
 As a result of ticket #17305, wp_mail() accepts the $to parameter in the
 format "Name <email at domain.com>".

 There exists a PHP bug in versions below 5.2.11 and in 5.3, on Windows.
 This bug occurs when addresses are passed to the PHP mail() function in
 the "Name <email>" format and prevents e-mails from being sent. I believe
 this bug in fixed in 5.3.1 and above. (see
 https://bugs.php.net/bug.php?id=28038)

 I don't believe this affects any core functionality, but may affect some
 plugins which pass $to in the above format.

 I tested in PHP 5.2.4 on Windows with the following code:

 {{{
 wp_mail("email at ext.com", "Test", "Test");
 wp_mail("Name <email at ext.com>", "Test 2", "Test 2");
 }}}

 The first email is received; the second isn't. When removing error
 suppression from the mail() calls in class-phpmailer.php, the following
 warning is outputted:

   Warning: mail() [function.mail]: SMTP server response: 501 <Name
 <email at ext.com>>: "@" or "." expected after "Name" in C:\xampplite\htdocs
 \wp-includes\class-phpmailer.php on line 771

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23243>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list