php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5230 sendmail.c php4.0 missing code from version 3.0 for multiple recipients and CC
Submitted: 2000-06-26 01:45 UTC Modified: 2000-07-12 12:51 UTC
From: joel at intwebservices dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.0 Release OS: Windows NT 4.0
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: joel at intwebservices dot com
New email:
PHP Version: OS:

 

 [2000-06-26 01:45 UTC] joel at intwebservices dot com
After checking through the sendmail.c code for version 3 and 4, I noticed that the code for multiple recipients and CC which was in version 3 is not included in version 4 in the SendText() function.
This might explain why Mail() does not send to multiple recipients or CC in version 4.0.

This code from version 3 is missing in version 4.
----------------------------------------------------------------------------
	tempMailTo = estrdup(mailTo);
	
	// Send mail to all rcpt's
	token = strtok(tempMailTo, ",");
	while(token != NULL)
	{
		sprintf(GLOBAL(Buffer), "RCPT TO:<%s>\r\n", token);
		if ((res = Post(GLOBAL(Buffer))) != SUCCESS)
			return (res);
		if ((res = Ack()) != SUCCESS)
			return (res);
		token = strtok(NULL, ",");
	}

	// Send mail to all Cc rcpt's
	efree(tempMailTo);
	if (pos1 = strstr(headers, "Cc:")) {
		pos2 = strstr(pos1, "\r\n");
		tempMailTo = estrndup(pos1, pos2-pos1);

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-28 12:19 UTC] hholzgra at cvs dot php dot net
fixed in latest cvs
 [2000-07-04 23:11 UTC] hholzgra at cvs dot php dot net
the "fix" was rejected due to compilation problems
as my win system broke down i won't be able to
look at it until i get myself a new machine 
 [2000-07-12 12:51 UTC] jah at cvs dot php dot net
Fixed in cvs
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 16:02:26 2025 UTC