0

当发布新回复时,我正在使用 php mail 向消息线程中的所有成员发送邮件。

            include('Mail.php');
            include('Mail/mime.php');

            // Constructing the email
            $sender = "sender@sender.com";                              // 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);

现在,我将收件人称为“成员”。是否可以将其更改为个人用户名并仍然使用密件抄送功能?

4

1 回答 1

0

你不能。您可以使用长密件抄送列表向所有收件人发送相同的消息,也可以向每个用户发送一条个性化消息(为每个用户mail()单独调用),但无法为每个收件人发送一封不同的电子邮件。

于 2013-01-21T21:12:01.747 回答