Я использую php mail для отправки почты всем участникам в потоке сообщений, когда публикуется новый ответ.
include('Mail.php');
include('Mail/mime.php');
// Constructing the email
$sender = "[email protected]"; // Your name and email address
//$to= "" ; // The Recipients name and email address
$subject = $Sname." has posted a reply"; // Subject for the email
$html = "<html><body><p> DearMember, <br> $Sname has replied to one of your posts. </p></body></html>";
$crlf = "\n";
$headers = array(
'From' => $sender,
'Return-Path' => $sender,
'Subject' => $subject,
'Bcc' => $recipients
);
// Creating the Mime message
$mime = new Mail_mime($crlf);
// Setting the body of the email
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$headers = $mime->headers($headers);
// Sending the email
$mail =& Mail::factory('mail');
$mail->send(null, $headers, $body);
Прямо сейчас я обращаюсь к получателю как «член». Можно ли изменить это на отдельные имена пользователей и по-прежнему использовать функцию скрытой копии?