> while($row = mysqli_fetch_assoc($result)) > { > extract($row); > > $mail->IsSMTP(); > $mail->Host = "host.com"; > $mail->From = "[EMAIL PROTECTED]"; > > $mail->From = "[EMAIL PROTECTED]"; > $mail->FromName = "Company"; > $mail->AddAddress("$email", "$Contact"); > > $mail->IsHTML(True); > $mail->Subject = "$Subject"; > $mail->Body = "$PR"; > $mail->WordWrap = 50; > > > > if(!$mail->Send()) > { > echo 'Message was not sent.'; > echo 'Mailer error: ' . $mail->ErrorInfo; > } > else > { > echo 'Message has been sent.'; > } > > }
I bet your while loop over the "extract" is causing you to have: user1 user1, user2 user1, user2, user3,... Instead of polluting your symbol table, can't you just use the email field? $email = $row['theEmailField']; I've used code like this back in the day (Notice how the array $arr was unset): $recipients = "[EMAIL PROTECTED]&[EMAIL PROTECTED]&[EMAIL PROTECTED]"; parse_str($recipients); for($i=0; $i<count($arr); $i++){ mail("$arr[$i]", "$subject", "$message", "From: <$sender>\n". "Reply-To: <$sender>\n"); } unset($arr); _________________________________________________________________ Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare! http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews