När du har skickat ett e-postmeddelande $mail->Send()
, kör detta:
$mail->ClearAllRecipients();
i din while-loop.
Så din grundläggande while-loopstruktur ser ut så här:
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
}