oop - Sending Multiple Mails In PHP Mailer -
i have been writing trigger mails email using php mailer. problem code is sending multiple mails single recipient. tried using function singleto
didn't seem work.
$mail = new phpmailer(); for($i = 0; $i <= sizeof($emailid); $i++) { $mail->wordwrap = 50; $mail->ishtml(true); $mail->singleto = true; $mail->addaddress($emailid[$i],$name[$i]); $mail->subject = 'some subject'; $mail->body = "some body"; $mail->altbody = "some body"; $errornumber[$i] = 1; if(!$mail->send()) { $errorinfo[$i] = $mail->errorinfo; $errornumber[$i] = 0; } }
i using same script, set this:
while(...) { $mail = new phpmailer(); //reset class instance new 1 ..... $mail->from = $fromaddress; $mail->fromname = $fromaddress; $mail->addaddress($toadress); .... }
.... - same code have
Comments
Post a Comment