[geeklog-cvs] geeklog: Added support for Bcc - Blind copy.

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Jun 15 10:08:46 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/3b8700815448
changeset: 7122:3b8700815448
user:      blaine Lang <blaine at portalparts.com>
date:      Mon Jun 15 10:07:53 2009 -0400
description:
Added support for Bcc - Blind copy.

diffstat:

 public_html/lib-common.php |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diffs (71 lines):

diff -r 1f0d602ba92b -r 3b8700815448 public_html/lib-common.php
--- a/public_html/lib-common.php	Mon Jun 15 12:53:08 2009 +0200
+++ b/public_html/lib-common.php	Mon Jun 15 10:07:53 2009 -0400
@@ -1360,7 +1360,7 @@
     } else {
         $displayRightBlocks = false;
     }
-    
+
     if ($displayRightBlocks)
     {
         /* Check if an array has been passed that includes the name of a plugin
@@ -1379,7 +1379,7 @@
         } else {
             $rblocks = COM_showBlocks( 'right', $topic );
         }
-        
+
         if( empty( $rblocks ))
         {
             $footer->set_var( 'geeklog_blocks', '');
@@ -3177,10 +3177,11 @@
 * @param    boolean     $html       (optional) true if to be sent as HTML email
 * @param    int         $priority   (optional) add X-Priority header, if > 0
 * @param    string      $cc         (optional) other recipients (name + email)
+* @param    string      $bcc        (optional) Blind Copy recipients
 * @return   boolean                 true if successful,  otherwise false
 *
 */
-function COM_mail( $to, $subject, $message, $from = '', $html = false, $priority = 0, $cc = '' )
+function COM_mail( $to, $subject, $message, $from = '', $html = false, $priority = 0, $cc = '', $bcc = '' )
 {
     global $_CONF;
 
@@ -3193,6 +3194,7 @@
 
     $to = substr( $to, 0, strcspn( $to, "\r\n" ));
     $cc = substr( $cc, 0, strcspn( $cc, "\r\n" ));
+    $bcc = substr( $bcc, 0, strcspn( $bcc, "\r\n" ));
     $from = substr( $from, 0, strcspn( $from, "\r\n" ));
     $subject = substr( $subject, 0, strcspn( $subject, "\r\n" ));
     $subject = COM_emailEscape( $subject );
@@ -3232,6 +3234,10 @@
     {
         $headers['Cc'] = $cc;
     }
+    if( !empty( $bcc ))
+    {
+        $headers['Bcc'] = $bcc;
+    }
     $headers['Date'] = date( 'r' ); // RFC822 formatted date
     if( $method == 'smtp' )
     {
@@ -3568,7 +3574,7 @@
             $A = DB_fetchArray($result);
         }
     }
-    
+
     if( array_key_exists( 'onleft', $A ) )
     {
         if( $A['onleft'] == 1 )
@@ -4490,7 +4496,7 @@
 *
 * Display one of the predefined messages from the $MESSAGE array. If a plugin
 * name is provided, display that plugin's message instead.
-* 
+*
 * @param    int     $msg        ID of message to show
 * @param    string  $plugin     Optional name of plugin to lookup plugin defined message
 * @return   string              HTML block with message



More information about the geeklog-cvs mailing list