phpmailerHow do I use PHPMailer to add a BCC recipient?
To use PHPMailer to add a BCC recipient, you can use the addBCC()
method. This method takes two parameters - the email address of the recipient, and an optional name for the recipient.
Example code
$mail = new PHPMailer;
$mail->addBCC('[email protected]', 'John Doe');
The code above will add a BCC recipient with the email address [email protected]
and the name John Doe
.
Code explanation
$mail = new PHPMailer;
- creates a new instance of the PHPMailer class.$mail->addBCC('[email protected]', 'John Doe');
- adds a BCC recipient with the email address[email protected]
and the nameJohn Doe
.
Helpful links
More of Phpmailer
- How can I use PHPMailer without SMTP secure?
- How do I use PHPMailer to attach a ZIP file?
- How do I use PHPMailer with OAuth2 authentication for Microsoft accounts?
- How can I configure PHPMailer to support Polish characters?
- How can I configure PHPMailer to work with GoDaddy?
- How can I configure PHPMailer to ignore TLS certificate errors?
- How do I configure PHPMailer to use a proxy?
- How can I use PHPMailer to connect to a POP3 server?
- How do I get the message ID of a sent email using PHPMailer?
- How to use PHPMailer with PHP 7.4?
See more codes...