我有这个工作良好的联系表。如果有人给我发电子邮件,我会收到。但无论出于何种原因,我不断收到发送给我的空电子邮件。由于没有人可以访问该页面,我确定不是有人向我发送空电子邮件。我不知道问题是什么。有什么帮助吗?
<form method="post" id="contactform" name="contactform" action="comment.php" id="ContactForm" name="ContactForm" method="post">
<fieldset>
<label>Email *</label>
<input class="text" type="text" name="email">
<label>Name *</label>
<input class="text" type="text" name="name" />
</fieldset>
<input class="submit-button" type="submit" name="submit" id="submit" value="Send" />
</form>
and my contact.php
<?php
$email.= "<b>Email : </b>".trim($_POST['company'])."<br/>";
$email.= "<b>Name : </b>".trim($_POST['name'])."<br/>";
//Replace YourEmailAddress@Yourdomain.com with yours, eg:contactus@mywebsite.com
//Both on the next line and on the mail function below.
$headers = "From: email@email.com\r\n";
$headers .= "Content-Type: text/html";
mail(
"Your Name<myname>",
"Header",
$email,
$headers
);
header("www.google.com");
?>
我的 php 表单中的“标题”部分是在发送表单后将用户重定向到页面。
提前致谢。