0

I have created a PHP/HTML form and for some reason it doesn't send the info to my email here is my Code

PHP

<?php
$email = $_POST['email'];
$dropdown = $_POST['dropdown'];
$game = $_POST['game'];
$describe = $_POST['describe'];
$form = "From $email";
$to = 'godlikegames@outlook.dk';
$subject = 'Game report';

$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html\r\n";
$headers = 'From: from@example.com' . "\r\n" .
'Reply-To: reply@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

$mailheader = "From $email\r\n";
$body = "E-Mail: $email\n Message:\n $describe";

if ($_POST['submit']) {
    if ($email != '') {
           if (mail('godlikegames@outlook.dk', $subject, $describe, $from))     {
            header("location: http://www.godlike-games.com/Thankyou.html");
        } else {
        echo "<script type=\"text/javascript\">window.alert('Something went     wrong, Reloading. . .');
        window.location.href = '/ReportABug.html';</script>";
        exit;
        }
    } else {
      echo "<script type=\"text/javascript\">window.alert('You forgot to fill     out something, Reloading. . .');
      window.location.href = '/ReportABug.html';</script>";
      exit;
    }
}
?>
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
LTS BANG
  • 31
  • 2
  • What debugging have you done? What _is_ happening? – Patrick Q Oct 20 '16 at 17:41
  • PHP's internal mail() function needs configuration in php.ini, look for the [mail function] section of the configuration file. Not saying this is the cause of your issue, but if you're using something like WAMP/LAMP and expecting mail() to just know where to route your email too, you're not gonna get far. – Mark Phillips Oct 20 '16 at 17:52
  • But what do i need to write in my php.ini to recieve the mail from my form? – LTS BANG Oct 20 '16 at 21:09

0 Answers0