I'm trying to generate a mass email with the BCC list coming out of a database table. The message body comes from a form POST...
here's what I have so far:
// query subscriber emails
$query = "SELECT Email FROM table";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
//send email to subscribers
$EmailMsg = "Weekly Email\n\n";
$EmailMsg .= "$Message\n\n";
$to = "email@company.com";
$subject = "Weekly Tip";
$mailheaders = "From:email@company.com\n";
$mailheaders .= "Reply-to: noreply@company.com\n";
while ($row = msql_fetch_object($result)) {
echo $row->Email;
$Email = $row['Email'];
echo $mailheaders .= "Bcc: $Email\n";
}
mail($to, $subject, $EmailMsg, $mailheaders);
I get this error: Fatal error: Call to undefined function: msql_fetch_array()
Can anybody tell me what I'm doing wrong?