In the example on the page https://github.com/PHPMailer/PHPMailer at the very bottom of the block with e-mail addresses there are 2 addresses: addCC and addBCC - what are they for?

//Recipients $mail->setFrom('from@example.com', 'Mailer'); $mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient $mail->addAddress('ellen@example.com'); // Name is optional $mail->addReplyTo('info@example.com', 'Information'); $mail->addCC('cc@example.com'); $mail->addBCC('bcc@example.com'); 

    1 answer 1

    Add CC and BCC headers to the letter.

    CC ( Carbon Copy ) - a copy of the letter. In addition to the recipient, the letter will be sent to these addresses. The recipient of each letter will see the full list of those to whom the letter was sent.

    BCC ( Blind Carbon Copy ) - a hidden copy of the letter. The RFC describes 3 possible behaviors:

    • when preparing a letter for dispatch, this header is removed from the letter and sent, besides the TO and CC lists, by a copy of the letter to each of the addresses indicated in this header. Accordingly, the addressees do not see that this is a copy.
    • similarly sent copies of letters, but to send copies on the BCC list, the header remains. Recipients from the to and CC lists do not receive this header, recipients from the BCC list respectively see the entire BCC list.
    • A blank BCC header may be sent to recipients indicating that hidden copies of the letter were sent to someone