From 58ad760b3c4b6604fa96d794f90a5d0211f43a80 Mon Sep 17 00:00:00 2001 From: the_systech Date: Fri, 4 Jan 2002 17:25:54 +0000 Subject: fix for mass mail bug, plus some cleanups for php3 compatibility..CC and BCC headers are now handled properly, and there is no longer any foreach statments used. git-svn-id: file:///svn/phpbb/trunk@1799 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/smtp.php | 49 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 5 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/smtp.php b/phpBB/includes/smtp.php index 13c90e7e80..f14e836730 100644 --- a/phpBB/includes/smtp.php +++ b/phpBB/includes/smtp.php @@ -80,8 +80,34 @@ function smtpmail($mail_to, $subject, $message, $headers = "") } $headers = chop($headers); + // // Make sure there are no bare linefeeds in the headers + // $headers = preg_replace("/(?, "; } - + // Ok now do the CC and BCC fields... + @reset( $bcc ); + while( list( , $bcc_address ) = each( $bcc )) + { + fputs( $socket, "RCPT TO: $bcc_address\r\n" ); + server_parse( $socket, "250" ); + } + @reset( $cc ); + while( list( , $cc_address ) = each( $cc )) + { + fputs($socket, "RCPT TO: $cc_address\r\n"); + server_parse($socket, "250"); + } // Ok now we tell the server we are ready to start sending data fputs($socket, "DATA\r\n"); @@ -155,4 +194,4 @@ function smtpmail($mail_to, $subject, $message, $headers = "") return TRUE; } -?> \ No newline at end of file +?> -- cgit v1.2.1