Separate headers by \r\n
.
function emailHTML($to, $from, $subject, $HTMLmessage) {
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers = "From: ".$from . "\r\n";
$headers .= "Bcc: email@example.com\r\n";
$headers .=
"MIME-Version: 1.0\r\n" .
"Content-Type: multipart/mixed;\r\n" .
" boundary=\"{$mime_boundary}\"";
$content .=
"This is a multi-part message in MIME format.\r\n\r\n" .
"--{$mime_boundary}\r\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\r\n" .
"Content-Transfer-Encoding: 7bit\r\n\r\n" .
$HTMLmessage . "\r\n\r\n";
$ok = @mail($to, $subject, $content, $headers);
if(!$ok) {
die("Error sending email");
}
}