2013-01-21 4 views
0

새 답글이 게시 될 때 php 메일을 사용하여 메일 스레드의 모든 회원에게 메일을 보냅니다.BCC 기능을 사용하면서 메일마다 인사말 사용자 이름을 변경하는 PHP 메일

  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); 

바로 지금받는 사람을 "회원"으로 지정합니다. 개별 사용자 이름으로 변경하고 숨은 참조 기능을 사용할 수 있습니까?

답변

0

아니요, 불가능합니다. 긴 숨은 참조 목록을 사용하여 모든 수신자에게 동일한 메시지를 보내거나 각 사용자에게 맞춤 메시지 하나를 보낼 수 있습니다 (각 수신자에게 개별적으로 mail() 전화). 그러나 각 수신자마다 다른 단일 이메일을 보낼 방법이 없습니다 .