9951 explained code solutions for 126 technologies


phpmailerHow do I use PHPMailer to add a carbon copy recipient?


Using PHPMailer to add a carbon copy recipient is very simple. All you need to do is add a line of code to your existing PHPMailer script.

$mail->addCC('[email protected]');

This line of code will add a carbon copy recipient to your email.

The code above consists of two parts:

  1. $mail->addCC('[email protected]'); - This is the command used to add a carbon copy recipient.
  2. [email protected] - This is the email address of the carbon copy recipient.

No output is generated when this code is executed.

For more information, please see the PHPMailer documentation.

Edit this code on GitHub