|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11247 mail() on Win32 messes with Reply-To: or Errors-To: fields,
Submitted: 2001-06-01 19:06 UTC Modified: 2002-05-27 17:47 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: olivier dot cahagne at epita dot fr Assigned:
Status: Closed Package: Mail related
PHP Version: 4.0.4pl1 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: olivier dot cahagne at epita dot fr
New email:
PHP Version: OS:


 [2001-06-01 19:06 UTC] olivier dot cahagne at epita dot fr
PHP 4.0.5
Platform: Win32 only.
mail() -> SMTP bug.

Sending a mail on Win32 platform with php.ini having set smtp_server correctly works fine.
However, when setting an additional header like:
or even
will result in an e-mail not containing any To: field.

I looked at win32/sendmail.c and saw these lines
if(!xheaders || !strstr(xheaders, "To:")){
p += sprintf(p, "To: %s\r\n', mailTo);
I believe it incorrectly recognize any "xxxxx-To:" Field and then messes the mail headers.

This bug doesn't occur on Unix platforms using sendmail, postfix, etc.
The SMTP server used here works fine if I use my own SMTP class. However, I believe this is a bug so it can be fixed by someone more knowledgable than me.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-01 19:21 UTC] olivier dot cahagne at epita dot fr
Sorry, this was with PHP 4.0.4pl1 as first reported.
 [2001-06-22 18:28 UTC]
windows mailcode needs a rewrite
 [2002-05-15 06:18 UTC]
I believe this behaviour isn't true anymore for To: , can you verify this with latest stable win32 release?
 [2002-05-27 17:40 UTC] olivier dot cahagne at epita dot fr
Now works fine using PHP 4.2.1 on Win2k.

This was fixed indeed with win32/sendmail.c v.1.23:
 [2002-05-27 17:47 UTC]
Closing then
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jun 15 11:01:24 2021 UTC