|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10182 mail() $to parameter doesn't accept rfc822 style addresses
Submitted: 2001-04-05 09:46 UTC Modified: 2005-09-02 07:30 UTC
Avg. Score:4.8 ± 0.4
Reproduced:6 of 7 (85.7%)
Same Version:4 (66.7%)
Same OS:5 (83.3%)
From: apere at agilitime dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 3CVS OS: Any Windows
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.
Bug Type:
From: apere at agilitime dot com
New email:
PHP Version: OS:


 [2001-04-05 09:46 UTC] apere at agilitime dot com
Ok, I have found several notes telling that the following syntax works :

$to = "\"Arnaud PERE\" <>";
mail ($to,"subject","message");

But when I try this, my SMTP server says :
(bad host/domain syntax: ">")

see the trailing ">"...

Instead, I tried the following syntax which appeared to work :

$to = " (Arnaud PERE)";
mail ($to,"subject","message");

This problem does not appear on the Unix version of PHP4.04pl1, but only on the windows version.

Did I do something wrong ?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-22 18:47 UTC]
windows mail code *badly* needs a rewirte
 [2002-06-02 11:15 UTC]
Updated summary, Version, Status, OS
 [2002-07-12 05:37 UTC] david at acz dot org
Why does it have to be Windows only?  I would *really* like to see integrated SMTP support in PHP on UNIX platforms.  Keeping it Windows only seems silly.  Yes, I know it's easy to code SMTP stuff in PHP, but as long as the code is there...
 [2002-07-12 05:44 UTC]
for now it will stay windows only at least as long
as we are not perfectily sure that the new code 
realy works

there is no use in replacing a working solution 
with stuff still marked as experimental 

(although mfisher did a lot of good work on it lately
 that improved the situation on windows quite a bit :)
 [2002-07-12 06:01 UTC]
thx :)

to david: if you need that kind of feature maybe you should use the existing mail classes which support (e)smtp (there's one on and one on )
 [2002-08-07 02:52 UTC] mbretter at jawa dot at
the problem is, that the mail command itself adds < and > at the beginning and at the end of to-e-mail adress. if you have $to = '<>';

then implicit you have <<>> and some mailservers don't like this.
 [2005-09-02 07:30 UTC]
There's already other report about this. (clearing out old reports forgotten due to a bug in bug system :)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 03:01:30 2024 UTC