Salut
Nu am folosit PHP cu BCC pentru email ca sa stiu practic cum functioneaza.
Incearca sa retii intr-o variabila email-urile separate prin virgula si spatiu, cam asa:
Cod: Selectaţi tot
$bcc = 'nume1@domeniu.com, nume2@domeniu.net, ...';
Apoi aplica una din aceste variante
1.
Cod: Selectaţi tot
$from = "Site meu <admin@site.ro>";
$to = "Nume Prenume <email@domeniu.ro>";
$bcc = 'nume1@domeniu.com, nume2@domeniu.net, ...';
$smtp_to = array ( 'To' => $to, 'Bcc' => $bcc);
$subject = "Jurnal";
$body = "Test!";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject,
'MIME-Version' => "1.0",
'Content-type' => "text/html; charset=iso-8859-1\r\n\r\n");
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password)
);
$mail = $smtp->send($smtp_to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("Mesaj trimis");
}
2.
Cod: Selectaţi tot
include("Mail.php");
/* mail setup recipients, subject etc */
$subject = "Your Test Email";
$message = "This is a test message. \n";
$to= 'to_nam3@domain.com' ;
$bcc = 'nume1@domeniu.com, nume2@domeniu.net, ...';
$recipients = $to.",".$bcc;
$headers["From"] = "who@whatever";
$headers["To"] = $to;
$headers["Reply-To"] = 'who@whatever';
$headers["Subject"] = $subject;
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "YOURSITEMAILSERVER.whatever";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "Emailaddress@YOURSITEMAILSERVER.whatever";
$smtpinfo["password"] = "EMAIL_PASSWORD";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $message);
Daca nu merge, vezi ce gasesti pe net cautand: "php smtp mail bcc" .