ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-cvs
php-cvs
[PHP-CVS] cvs: php4(PHP_4_3) /ext/imap php_imap.c
by Frank M. Kromann other posts by this author
Nov 30 2002 9:52PM messages near this date
[PHP-CVS] cvs: php4 /sapi/milter CREDITS Makefile.frag config.m4 php_milter.c | [PHP-CVS] cvs: php4(PHP_4_3) /win32 sendmail.c
fmk		Sat Nov 30 16:52:36 2002 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/ext/imap	php_imap.c 
  Log:
  MFH
  
  
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.142.2.1 php4/ext/imap/php_imap.c:1.142.2.2
--- php4/ext/imap/php_imap.c:1.142.2.1	Wed Nov 27 13:54:54 2002
+++ php4/ext/imap/php_imap.c	Sat Nov 30 16:52:36 2002
@@ -26,7 +26,7 @@
    | PHP 4.0 updates:  Zeev Suraski <zeev@[...].com>                        |
    +----------------------------------------------------------------------+
  */
-/* $Id: php_imap.c,v 1.142.2.1 2002/11/27 18:54:54 fmk Exp $ */
+/* $Id: php_imap.c,v 1.142.2.2 2002/11/30 21:52:36 fmk Exp $ */
 
 #define IMAP41
 
@@ -3144,10 +3144,22 @@
 	char *tempMailTo;
 	char *tsm_errmsg = NULL;
 	ADDRESS *addr;
-	char *bufferTo = NULL, *bufferCc = NULL, *bufferBcc = NULL;
-	int offset;
+	char *bufferTo = NULL, *bufferCc = NULL, *bufferBcc = NULL, *bufferHeader = NULL;
+	int offset, bufferLen = 0;;
 
+	if (headers)
+		bufferLen += strlen(headers);
+	if (to)
+		bufferLen += strlen(to) + 6;
+	if (cc)
+		bufferLen += strlen(cc) + 6;
+
+	bufferHeader = (char *)emalloc(bufferLen);
+	memset(bufferHeader, 0, bufferLen);
 	if (to && *to) {
+		strcat(bufferHeader, "To: ");
+		strcat(bufferHeader, to);
+		strcat(bufferHeader, "\r\n");
 		tempMailTo = estrdup(to);
 		bufferTo = (char *)emalloc(strlen(to));
 		offset = 0;
@@ -3168,6 +3180,9 @@
 	}
 
 	if (cc && *cc) {
+		strcat(bufferHeader, "Cc: ");
+		strcat(bufferHeader, cc);
+		strcat(bufferHeader, "\r\n");
 		tempMailTo = estrdup(cc);
 		bufferCc = (char *)emalloc(strlen(cc));
 		offset = 0;
@@ -3207,8 +3222,9 @@
 		}
 	}
 
+	strcat(bufferHeader, headers);
 
-	if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, bufferTo, message,
 bufferCc, bufferBcc, rpath) != SUCCESS) {
+	if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, mes
sage, bufferCc, bufferBcc, rpath) != SUCCESS) {
 		if (tsm_errmsg) {
 			php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), tsm_errmsg);
 			efree(tsm_errmsg);
@@ -3225,6 +3241,9 @@
 	}
 	if (bufferBcc) {
 		efree(bufferBcc);
+	}
+	if (bufferHeader) {
+		efree(bufferHeader);
 	}
 #else
 	if (!INI_STR("sendmail_path")) {



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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved