#45249 [Com]: Invalid e-mail address when using name
| From: | php at info-svc dot com | Date: | Tue, 24 Jun 2008 17:03:32 +0000 |
| Subject: | #45249 [Com]: Invalid e-mail address when using name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125990@lists.php.net to get a copy of this message | ||
ID: 45249
Comment by: php at info-svc dot com
Reported By: dannyoneill at ntlworld dot com
Status: Open
Bug Type: Mail related
Operating System: Windows Server 2003 SP2
PHP Version: 5.2.6
New Comment:
Possible duplicate and more information posted at
http://bugs.php.net/bug.php?id=45305
Previous Comments:
------------------------------------------------------------------------
[2008-06-12 15:59:33] dannyoneill at ntlworld dot com
Description:
------------
Since upgrading to PHP 5.2.6 I can no longer use a full email address.
When sending an email to "Joe Blogs <joe@example.com>" 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
<joe@example.com>>". It tries to help and add more <> brackets than
necessary.
The only thing changed on my server is PHP. Others have reported the
problem on phpfreaks.com. 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 "joe@example.com" without any
<> brackets it works fine but cannot use the name.
Reproduce code:
---------------
<?php
$mailto = "myemail@mydomain.com" ;
$subject = "Mintyslippers Feedback" ;
$messageproper = "Test";
mail($mailto, $subject, $messageproper, "From: Test User
<test@theirdomain.com" );
?>
Expected result:
----------------
Sucessful email
Actual result:
--------------
Invalid e-mail address
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45249&edit=1