hi fellas,
anybody have a experience with phpmailer.class on loops (while)?
because i try to put the follow code into the loop while:
while......
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "192.168.66.150";
$mail->SMTPAuth = true;
$mail->Username = "intranet@abc.com";
$mail->Password = "my_pass";
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->From = $email_from;
$mail->FromName = $my_name;
$mail->AddReplyTo($email_destino,$my_name);
$mail->AddAttachment("/var/www/".$file);
$mail->AddAddress($email,$nome);
$mail->Subject = $subject;
$mail->Body = $formato_html;
$mail->AltBody = $formato_plain;
if(!$mail->Send()){
echo "Error: " . $mail->ErrorInfo;
exit;
}
end of while.
the problem is: if i have two or more destinations, this class make a copy of attachments, for example:
-for 1 destination (1 loop): he make 1 copy off each file
-for 2 destination (2 loop): he make 2 copy off each file.....etc
Any programmer have a idea to reset this class when he send the email?