i am trying to get this code to work but there is something wrong with the array (not to good at these). the main part of the code works it is sending out the email but only ever to one registered user.
here is the code i have so far.
$query = "SELECT email FROM emails";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
$contactemail = $row['email'];
// Contacts
//$replyName = $merc_replyId;
//$replyEmail = $merc_replyAddress;
$replyName = "PiPonliine";
$replyEmail = "info@piponline.info";
$contactname = "";
// Subject
$subject = "Website Update";
// Headers
$headers = "MIME-Version: 1.0" . PHP_EOL;
$headers .= "Content-type: text/html; charset=iso-8859-1" . PHP_EOL;
$headers .= "From: ".$replyName." <".$replyEmail.">" . PHP_EOL;
$headers .= "BCC: ".$contactname." <".$contactemail.">\r\n" . PHP_EOL;
mail($contactemail, $subject, $message, $headers);
}
echo "$contactemail";
echo "<h2>Email notification sent</h2>";
echo "<h2>1 record added</h2>";
mysql_close($con);