PHPMailer::addCC PHP Method

addCC() public method

Add a "CC" address.
public addCC ( string $address, string $name = '' ) : boolean
$address string The email address to send to
$name string
return boolean true on success, false if address already used or invalid in some way
    public function addCC($address, $name = '')
    {
        return $this->addOrEnqueueAnAddress('cc', $address, $name);
    }

Usage Example

Example #1
9
/**
 * email function
 *
 * @return bool | void
 **/
function email($to, $from_mail, $from_name, $subject, $message)
{
    require '../../PHPMailer/PHPMailerAutoload.php';
    $mail = new PHPMailer();
    $mail->From = $from_mail;
    $mail->FromName = $from_name;
    $mail->addAddress($to, $from_name);
    // Add a recipient
    $mail->addCC('');
    //Optional ; Use for CC
    $mail->addBCC('');
    //Optional ; Use for BCC
    $mail->WordWrap = 50;
    // Set word wrap to 50 characters
    $mail->isHTML(true);
    // Set email format to HTML
    //Remove below comment out code for SMTP stuff, otherwise don't touch this code.
    /*  
    $mail->isSMTP();
    $mail->Host = "mail.example.com";  //Set the hostname of the mail server
    $mail->Port = 25;  //Set the SMTP port number - likely to be 25, 465 or 587
    $mail->SMTPAuth = true;  //Whether to use SMTP authentication
    $mail->Username = "******"; //Username to use for SMTP authentication
    $mail->Password = "******"; //Password to use for SMTP authentication
    */
    $mail->Subject = $subject;
    $mail->Body = $message;
    if ($mail->send()) {
        return true;
    }
}
All Usage Examples Of PHPMailer::addCC