Po wysłaniu e-maila $mail->Send()
, wykonaj to:
$mail->ClearAllRecipients();
w pętli while.
Więc podstawowa struktura pętli while wygląda tak:
while($row = mysql_fetch_assoc($p_address)){
$mail->AddAddress($row['email_address']);
$mail->AddAttachment("fpdf/pdf_reports/document/".$ctrl_no.".pdf");
$mail->send();
$mail->ClearAllRecipients();
$mail->ClearAttachments(); //Remove all attachements
}