|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45932 Invalid e-mail address when using name
Submitted: 2008-08-27 09:23 UTC Modified: 2008-08-27 21:15 UTC
From: danny at mintyslippers dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 5.2.6 OS: Windows Server 2003 SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
8 + 32 = ?
Subscribe to this entry?

 [2008-08-27 09:23 UTC] danny at mintyslippers dot com
Since upgrading to PHP 5.2.6 I can no longer use a full email address.

When sending an email to "Joe Blogs <>" It fails with
"Invalid e-mail address". This is on a basic mail script.

It appears to be because PHP 5.2.6 reparses this as "<Joe Blogs
<>>". It tries to help and add more <> brackets than

The only thing changed on my server is PHP. Others have reported the
problem on I also tested on a freshly built virtual
server with the same results.

I also run wordpress which also fails when sending mails because of
this. If I write a script to just mailto "" without any
<> brackets it works fine but cannot use the name.

Reproduce code:

$mailto = "" ;
$subject = "Mintyslippers Feedback" ;

$messageproper = "Test";

mail($mailto, $subject, $messageproper,	"From: Test User
<" );

Expected result:
Sucessful email

Actual result:
Invalid e-mail address


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-27 21:15 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #28038
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 11:01:27 2023 UTC