-2

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?

shivampaw
  • 145
  • 1
  • 1
  • 9

1 Answers1

0

what is your server type??? if it's localhost you should config your mail service.

if it's server you have 2 situation:

  1. it's shared hosting.
  2. it's vps or dedicated server.

1:

some servers limit their services on mail function and it's for their security issue and blah blah. you can ask your service provider to release the access of this feature. and they make decision to deny or grant.

2:

if it's vps or dedicate server, contact to your server administration and tell him/her your mail function not working, they fix this problem ASAP.

Community
  • 1
  • 1