I've been working with this half the day today. Thanks to some of the posting I was able to go ahead. So in my case the following works:
<?
/ connection
db connection
db query/
while ($row=mysql_fetch_array($result))
{
/ in the following display_block- (empty space)$email,(empty space) !very important/
$email=$row['EMAIL'];
$display_block .="
$email, ";
}
$to="mainaddressee@hisserver.com";
$subject="TEST";
mail($to, $subject, $message, "from:joker@myserver.com\nBCC: $display_block");
echo "You mailing has been sent to:<br> $display_block ."
?>
I've found that:
1.it must be: nBCC and not nbcc!
2.email addresses must be separated by comma(,), not by semi-column(😉
3.resultset - in my case it is var. $display_block - must have empty space in front and empty space after the comma, otherwise all bcc addresses appear in the body of the message.