|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20538 Cc: in mail won't work in some cases
Submitted: 2002-11-21 03:52 UTC Modified: 2002-11-21 10:35 UTC
From: pvy at novosoft dot ru Assigned:
Status: Closed Package: *Mail Related
PHP Version: 4.2.3 OS: windows 2000/sp3
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: pvy at novosoft dot ru
New email:
PHP Version: OS:


 [2002-11-21 03:52 UTC] pvy at novosoft dot ru
I wrote small php script:
mail ('','subject','body','Cc:');

When my SMTP server points to unix machine (sendmail/linux) all working fine.
When I set SMTP server pointed to IIS5 SMTP server (localhost) I got 'Server Error message'. 

any idea? 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-21 03:56 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.
 [2002-11-21 05:21 UTC] pvy at novosoft dot ru
Why not a bug? why bogus? 
Please look at sendmail.c in win32 directory:
	if (headers && (pos1 = strstr(headers, "Cc:"))) {
		if (NULL == (pos2 = strstr(pos1, "\r\n"))) {
			tempMailTo = estrndup(pos1, strlen(pos1));
		} else {
			tempMailTo = estrndup(pos1, pos2-pos1);

		token = strtok(tempMailTo, ",");
		while(token != NULL)
			sprintf(Buffer, "RCPT TO:<%s>\r\n", token);
			if ((res = Post(Buffer)) != SUCCESS)
				return (res);
			if ((res = Ack()) != SUCCESS)
				return (res);
			token = strtok(NULL, ",");

in this code, we can see, what in Buffer posts line like:
RCPT TO: <Cc:> for first Cc: address and right string for (RCPT TO: <>)

it is really strange?

Right code:
if (headers && (pos1 = strstr(headers, "Cc:"))) {
		if (NULL == (pos2 = strstr(pos1, "\r\n")))
after this procedure add:
 [2002-11-21 05:29 UTC]
Please try using this CVS snapshot:
For Windows:
 [2002-11-21 10:35 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

  This is fixed correctly in sendmail.c:1.32. See for fix.

-- Joey
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 17:01:23 2023 UTC