[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] cvs: php4(PHP_4_3) /win32 sendmail.c
From:       "Frank M. Kromann" <frank () kromann ! info>
Date:       2002-11-30 21:51:20
[Download RAW message or body]

fmk		Sat Nov 30 16:51:20 2002 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/win32	sendmail.c 
  Log:
  MFH
  
  
Index: php4/win32/sendmail.c
diff -u php4/win32/sendmail.c:1.47 php4/win32/sendmail.c:1.47.2.1
--- php4/win32/sendmail.c:1.47	Sat Sep 21 11:03:24 2002
+++ php4/win32/sendmail.c	Sat Nov 30 16:51:19 2002
@@ -17,7 +17,7 @@
  *
  */
 
-/* $Id: sendmail.c,v 1.47 2002/09/21 15:03:24 mfischer Exp $ */
+/* $Id: sendmail.c,v 1.47.2.1 2002/11/30 21:51:19 fmk Exp $ */
 
 #include "php.h"				/*php specific */
 #include <stdio.h>
@@ -414,8 +414,28 @@
 	}
 	efree(tempMailTo);
 
+	if (mailCc && *mailCc) {
+		tempMailTo = estrdup(mailCc);
+		/* Send mail to all rcpt's */
+		token = strtok(tempMailTo, ",");
+		while(token != NULL)
+		{
+			snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
+			if ((res = Post(Buffer)) != SUCCESS) {
+				efree(tempMailTo);
+				return (res);
+			}
+			if ((res = Ack(&server_response)) != SUCCESS) {
+				SMTP_ERROR_RESPONSE(server_response);
+				efree(tempMailTo);
+				return (res);
+			}
+			token = strtok(NULL, ",");
+		}
+		efree(tempMailTo);
+	}
 	/* Send mail to all Cc rcpt's */
-	if (headers && (pos1 = strstr(headers_lc, "cc:"))) {
+	else if (headers && (pos1 = strstr(headers_lc, "cc:"))) {
 		/* Real offset is memaddress from the original headers + difference of
 		 * string found in the lowercase headrs + 3 characters to jump over
 		 * the cc: */
@@ -444,8 +464,11 @@
 		efree(tempMailTo);
 	}
 
-	if (mailCc && *mailCc) {
-		tempMailTo = estrdup(mailCc);
+	/* Send mail to all Bcc rcpt's
+	   This is basically a rip of the Cc code above.
+	   Just don't forget to remove the Bcc: from the header afterwards. */
+	if (mailBcc && *mailBcc) {
+		tempMailTo = estrdup(mailBcc);
 		/* Send mail to all rcpt's */
 		token = strtok(tempMailTo, ",");
 		while(token != NULL)
@@ -464,11 +487,7 @@
 		}
 		efree(tempMailTo);
 	}
-
-	/* Send mail to all Bcc rcpt's
-	   This is basically a rip of the Cc code above.
-	   Just don't forget to remove the Bcc: from the header afterwards. */
-	if (headers) {
+	else if (headers) {
 		if (pos1 = strstr(headers_lc, "bcc:")) {
 			/* Real offset is memaddress from the original headers + difference of
 			 * string found in the lowercase headrs + 4 characters to jump over
@@ -524,27 +543,6 @@
 				return OUT_OF_MEMORY;
 			}
 		}
-	}
-
-	if (mailBcc && *mailBcc) {
-		tempMailTo = estrdup(mailBcc);
-		/* Send mail to all rcpt's */
-		token = strtok(tempMailTo, ",");
-		while(token != NULL)
-		{
-			snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
-			if ((res = Post(Buffer)) != SUCCESS) {
-				efree(tempMailTo);
-				return (res);
-			}
-			if ((res = Ack(&server_response)) != SUCCESS) {
-				SMTP_ERROR_RESPONSE(server_response);
-				efree(tempMailTo);
-				return (res);
-			}
-			token = strtok(NULL, ",");
-		}
-		efree(tempMailTo);
 	}
 
 	if ((res = Post("DATA\r\n")) != SUCCESS) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic