<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$priority = $_POST['priority'];
$type = $_POST['type'];
$website = $_POST['website'];
$message = $_POST['message'];
$mail_to = 'info@mohdify.net';
$subject = 'Message from a site visitor '.$subject;
$body_message = "From: $name\n";
$body_message .= "E-mail: $email\n";
$body_message .= "Phone: $phone\n";
$body_message .= "Priority: $priority\n";
$body_message .= "Type: $type\n";
$body_message .= "Website: $website\n";
$body_message .= "Message: $message";
$headers = "From: $email";
$headers .= "Reply-To: $email";
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'contact_page.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please try ');
window.location = 'contact_page.html';
</script>
<?php
}
?>
这是 PHP 文件,但每次我尝试时,我都可以收到消息,但它不包含输入的值。
收到的电子邮件看起来像这样
From:
E-mail:
Phone:
Priority:
Type:
Website:
Message:
有人可以帮我解决我的问题吗?
谢谢,