php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45249 Invalid e-mail address when using name
Submitted: 2008-06-12 15:59 UTC Modified: 2008-07-06 14:15 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:2 (66.7%)
From: dannyoneill at ntlworld 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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dannyoneill at ntlworld dot com
New email:
PHP Version: OS:

 

 [2008-06-12 15:59 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-24 17:03 UTC] php at info-svc dot com
Possible duplicate and more information posted at http://bugs.php.net/bug.php?id=45305
 [2008-07-06 11:41 UTC] jani@php.net
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
 [2008-07-06 14:15 UTC] dannyoneill at ntlworld dot com
You have classed both mine and the other report as bogus rather than leaving one open.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC