It will send BCC now but I think the html code is screwing up becuase it keeps putting \ before every " how do I remove this without losing the html element?
<?php
// To email address
$email = " ".$_POST["to"]." ";
$email_name = "New";
// From email address
$from = "infor@mysite.co.uk";
$from_name = "Info";
// The message
$subject = " ".$_POST["subject"]." ";
$message = " ".$_POST["message"]."
";
$message_html = "<html>
<body>
".$_POST["message"]."
</p>
</body>
</html>";
$random_hash = md5(date("r", time()));
$mailmessage = "
--PHP-alt-".$random_hash."
Content-Type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
$message
--PHP-alt-".$random_hash."
Content-Type: text/html; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
$message_html
--PHP-alt-".$random_hash."--
";
// Headers
// To send HTML mail, the Content-type header must be set
$headers = "From: ".$from_name." <".$from.">" . "\r\n";
$headers .= "Reply-To: ".$from_name." <".$from.">" . "\r\n";
$headers .= "Bcc: ".$_POST["bccemail"]."" . "\r\n";
$headers .= "Date: ".date("r") . "\r\n";
// Additional headers
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\"\r\n";
$headers .= "Message-Id: <".md5(uniqid(microtime()))."@".$_SERVER["SERVER_NAME"].">\r\n";
// Send the mail
mail($email, $subject, $mailmessage, $headers);
echo "Email sent.";
?>
I am getting the following source code on my emails it is putting \ before everything how do I get rid of this? (I know its for the php)
<html>
<body>
<font color=\"#00000\">html test</font><p>
<img src=\"http://www.mysiteco.uk/emails/pic1.jpg\">
</p>
</body>
</html>