每当我填写contact.php表单并在contact.inc.php中调用邮件功能时,就会收到500-服务器错误。尽管它可以在我的一个网站上运行,但在其他网站上却不起作用(两者都在PHP 7.2中使用)。
我似乎没有发现任何错误。
$rand = rand(10000000, 99999999);
$preMessage = wordwrap($preMessage, 70, "\r\n");
$to = "vineherbie@gmail.com";
$headers = "From: ".$name." <".$mail.">\r\n";
$headers .= "Content-type: text/html\r\n";
$message = "You have received an e-mail from: ".$name." ".$lastname" - Case [".$rand."]<br><br>".$preMessage;
mail($to, $subject, $message, $headers);
header("Location: ../pages/contact.php/success=mail_sent");