Code: Select all
$result = mysql_query ("SELECT * FROM stocknotification WHERE title = '$title'");
while ($row = mysql_fetch_object($result))
{
$to = "info@domain.co.uk";
$bcc = "
$subject = "New Stock Arrival Notification";
$headers = "From: info@domain.co.uk";
$body = "
Dear customer.
A Support Email has been assigned to you.
Email Reference ID $id.
Best regards
COMPANY";
mail ($to, $subject, $body, $headers);
}I have posted something related to this query already, but this is different. I have a number of rows with the same title, but different email addresses. I want to query the db table, and assign the email address into one $bcc, so ONE email can go out, without going thru a loop and sending 200+ emails.
Anyone know a way, coz I have thought "outside the box" but cannot come up with the answer.