Below is the parsing code.
error_reporting(E_ALL);
ini_set('display_errors', '1');
$formbtn = $_POST['formbtn'];
$emails = $_POST['emails'];
if(isset($formbtn)){
$to = "xxxxxxx@xxxxx.com";
$subject = $_POST["subject"];
$body = nl2br($_POST["message"]);
$body .= "<br /><br /><br />If you wish to unsubscribe from these emails you must contact shiv via the alliance forums, clan chat, the supercell forums or by replying to this email.";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'Reply-To: xxxxxxxx@xxxxxxxx.xxxx' . "\r\n";
$headers .= "BCC: " . $emails . "\r";
if(mail($to, $subject, $body, $headers, "-fadmin@forumalliance.hol.es") ){
echo "Mail Sent!";
}
else
echo "Mail not sent!";
}else{
echo "Invalid form submission.";
The form works as intended and I am able to echo the variables: $emails, $formbtn, $body, $subject
When i send the mail I get mail not sent message.
Any ideas why this is happening?