In phpmailer() how to add bcc option ?
Started on: 30 April 13
Participants: 1
I am using phpmailer() class to send emails , how to add bcc (blind carbon copy) ?
my class is
$mail = new PHPMailer(true);
try {
$body = $message;
$mail->IsSMTP();
$mail->Host = $smpt_host;
$mail->SMTPAuth = $smtp_auth;
$mail->SMTPSecure = $smtp_secure;
$mail->Username = $smtp_user;
$mail->Password = $smtp_pass;
$mail->SetFrom($noreply, $noreply_name);
$mail->AddReplyTo($noreply,$noreply_name);
$mail->Subject = $subject;
$mail->MsgHTML($body);
$mail->AddAddress($to, $to_name);
$mail->Send();
return true;
}
my class is
$mail = new PHPMailer(true);
try {
$body = $message;
$mail->IsSMTP();
$mail->Host = $smpt_host;
$mail->SMTPAuth = $smtp_auth;
$mail->SMTPSecure = $smtp_secure;
$mail->Username = $smtp_user;
$mail->Password = $smtp_pass;
$mail->SetFrom($noreply, $noreply_name);
$mail->AddReplyTo($noreply,$noreply_name);
$mail->Subject = $subject;
$mail->MsgHTML($body);
$mail->AddAddress($to, $to_name);
$mail->Send();
return true;
}
This challenge is listed under
Open Source
, Development & Implementations
and Networks & IT Infrastructure
Community
Related Posts:
1 Suggestion
hi try this
$bcc = "xyz@domain.com"; (use ; for multiple)
$mail->AddAddress($to, $to_name); if($bcc)$mail->AddBCC($bcc); $mail->Send();