I'm trying to create a page to send emails to contacts in my database. I started by embedding an array in the page and then used a text file, both were successful and now I'm trying to take the information from a database.
$setEmailArray = array ("email@domain.co.uk", "email@domain.com");
for($i = 0; $i < count($setEmailArray); $i++){
mail ($setEmailArray[$i], $subject, $message, $headers);
This is basically the code from the embedded array. I got the following code and I'm not sure where to go with it.
$sql = "SELECT customer_email FROM customer";
$result = mysql_query ($sql, $con );
while( $row = mysql_fetch_row ($result) )
{
$customer_email[] = $row[1];
}
mysql_free_result( $result );
Any help would be greatly appreciated.
Thanks, Sam.