Hello,
At the end of this post you can find an extract of the code which works as an inquiry form. SPAM check and other have been omitted
I want the result sent to one email and to one Bcc email as well.
I added this line
[code=php]$headers .= "Bcc: private@hotmail.com\r\n"; [/code]
But it didn't work, it's like the headers line was ignored.
So I tried this line
[code=php]$headers .= "\r\nBcc: private@hotmail.com\r\n\r\n";[/code]
And that printed that line in the email itself, not the ideal result! It still sends to email, but not to bcc.
I'm obviously doing something wrong, so can someone point me in the right direction?
Thanks.
<?php
if(isset($_POST['Submitted'])) {
$Errors = Array();
$SendTo = "xx@xxx";
$Subject = "Online Enquiry";
$FromString = "From: ". $_POST['name'] ." \r\n";
$Indhold = "Please reply to this online enquiry form as soon as possible:\n";
$Indhold .= "\r";
$Indhold .= "Subject: ".$_POST['subject']."\n";
$Indhold .= "\r";
$Indhold .= "Name: ".$_POST['name']."\n";
$Indhold .= "\r";
$Indhold .= "e-mail: ".$_POST['email']."\n";
$Indhold .= "\r";
$Indhold .= "Comment:\r\n".preg_replace("(\r\n|\r|\n)","\r\n",$_POST['comment'])."\n";
$MailSuccess = mail($SendTo,$Subject,$headers,$Indhold,$FromString);
header("Location: thanks.php");
exit;
}
}
?>
<form id="contactform" method="post" action="enquiry.php">
<input type="hidden" name="Submitted" value="1" />