我正在创建一个网站,并且正在使用 PHP 制作联系表格。它在页面本身上没有出现任何错误,但电子邮件从未出现在我的电子邮件的收件箱或垃圾邮件文件夹中。我的代码是:
$_NAME = $_POST["name"];
$_EMAIL = $_POST["reply"];
$_SUBJECT = $_POST["subject"];
$_MESSAGE = $_POST["message"];
$_MAILTO = "myemail@gmail.com";
$_SUBJECT = "Contact Form";
$_FORMCONTENT = "From: ".$_NAME." Subject: ".$_SUBJECT." Message: ".$_MESSAGE;
$_MAILHEADER = "Reply To: ".$_EMAIL;
mail($_MAILTO, $_SUBJECT, $_FORMCONTENT, $_MAILHEADER);
任何想法是什么问题?
编辑 -
这是 HTML 表单:
<form id="contact" name="contact" action="contact2.php" method="post">
<input type="text" class="name" name="name" id="name" placeholder="Your name (optional)" onfocus="placeholder=''" onblur="placeholder='Your name (optional)'" /><br><br>
<input type="text" class="reply" id="reply" name="reply" placeholder="Your email (optional)" onfocus="placeholder=''" onblur="placeholder='Your email (optional)'" /><br><br>
<input type="text" class="subject" id="subject" name="subject" placeholder="Subject" onfocus="placeholder=''" onblur="placeholder='Subject'" /><br><br>
<textarea class="message" id="message" name="message" rows="10" cols="50" placeholder="Enter your message" onfocus="placeholder=''" onblur="placeholder='Enter your message'"></textarea><br><br>
<input type="submit" class="send" id="send" name="send" value="Send Message" />
</form>