我创建了一个PHP / HTML表单,由于某些原因,它不会将信息发送到我的电子邮件,这里是我的代码
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;
}
}
?>