Make WordPress Core


Ignore:
Timestamp:
06/16/2008 08:02:10 PM (18 years ago)
Author:
ryan
Message:

Handle cc and bcc. Props MattyRob. fixes #6899

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r8069 r8098  
    316316                                                $content_type = trim( $content );
    317317                                        }
     318                                } elseif ( 'cc' == strtolower($name) ) {
     319                                        $cc = explode(",", $content);
     320                                } elseif ( 'bcc' == strtolower($name) ) {
     321                                        $bcc = explode(",", $content);
    318322                                } else {
    319323                                        // Add it to our grand headers array
     
    360364        $phpmailer->Subject = $subject;
    361365        $phpmailer->Body = $message;
     366
     367        // Add any CC and BCC recipients
     368        if ( !empty($cc) ) {
     369                foreach ($cc as $recipient) {
     370                        $phpmailer->AddCc( trim($recipient) );
     371                }
     372        }
     373        if ( !empty($bcc) ) {
     374                foreach ($bcc as $recipient) {
     375                        $phpmailer->AddBcc( trim($recipient) );
     376                }
     377        }
    362378
    363379        // Set to use PHP's mail()
Note: See TracChangeset for help on using the changeset viewer.