2011-09-14 3 views
0

메일을 생성하는 무언가를 반복하면서 각각의 고유 항목을 고유 한 사람에게 보내고 싶습니다.

$ mail-> AddAddress를 사용할 때 다음에 루프 할 때 이전 루프의 모든 수신자를 포함하여 주소를 추가하고 모두 보냅니다.

어떻게 주소 변수를 재설정 할 수 있습니까?

 loop(xtimes){ 

     [generate customer $message] 

     $mail->Host  = "smut.blabla.com"; 
     $mail->port = 25; 
     $mail->AddReplyTo('[email protected]', 'test name'); 
     $mail->AddAddress($currentEmployeeEmail); 
     $mail->SetFrom('[email protected]', 'test name'); 
     $mail->Subject = "Your Daily Report, for $currentEmployee - $reportDate"; 
     $mail->MsgHTML($message); 
     $mail->AddAttachment('logo_white.png'); 
     $mail->Send(); 
     } 

SetAddress와 동일한 항목이 있습니까? 당신이 좋아하는, 루프의 시작 부분에 새로운 우편물을 만들 경우 어떻게

답변

3

:

$mail->ClearAddresses(); 
0

당신은 사용할 수 있습니다 : 내가 기억하는 경우

$mail = new PHPMailer(); 

은 같은, 또한 ClearAddresses 방법이있다 :

$mail->ClearAllRecipients()