I am using phpmailer to sent email, and it works the recipients receive the mail except the bcc and cc details is not showing the mail. Someone can suggest a solution to this . the code is
require_once("PHPMailer_v5.1/class.phpmailer.php");
require_once("PHPMailer_v5.1/language/phpmailer.lang-en.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->SMTPAuth = true;
$mailer->SMTPSecure = "tls";
$mailer->Host = 'smtp.gmail.com';
$mailer->Port = 587;
$mailer->Username = "myuserid";
$mailer->Password = "mypassword";
$mailer->FromName = $fromname;
$mailer->From = "myuserid";
$mailer->AddAddress("[email protected]",$toname);
$mailer->Subject = $subject;
$mailer->Body =$content;
$mailer->AddCC("[email protected]", "bla");
$mailer->AddBCC("[email protected]", "test");
if(!$mailer->Send())
{
echo "Message was not sent";
}
else
echo "mail sent";
PHP PHPMailer::addBCC - 30 examples found. These are the top rated real world PHP examples of PHPMailer::addBCC extracted from open source projects. You can rate examples to help us improve the quality of examples.
These are the top rated real world PHP examples of PHPMailer::addBCC extracted from open source projects. You can rate examples to help us improve the quality of examples.
The setting is $mail->AddCC (MAIL_CC); define ('MAIL_CC', ' [email protected] '); Sorry, something went wrong. @madhukaleeckal In the code snippet you posted you are only defining MAIL_CC after you are using it!?
Use as
$mailer->AddBCC("[email protected]", "test");
$mailer->AddCC("[email protected]", "bla");
You never see BCC details. That's what they are BCC details for. Even the recipient of a BCC will not see his own name with the recipients.
PS: You noticed you wrote addBCC
instead of AddBCC
(capital A
)?
From the phpMailer function reference:
Adds a "Bcc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
This might be causing your issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With