我知道其中一些帖子已经发布,并且我通读了它们,但无法找到解决我的问题的方法。PHP 和 HTML 看起来不错,所以我不确定为什么我没有收到来自提交的联系表单的任何电子邮件。
这是PHP:
<?php
$Fname = $_POST ['Fname'];
$Lname = $_POST ['Lname'];
$email = $_POST ['email'];
$message = $_POST ['message'];
$to = 'myName@mywebsite.com';
$subject = 'Contact From My Website';
$msg = " First Name: $Fname/n" .
"Last Name: $Lname/n" .
"Email: $email/n" .
"Message: $message";
mail ($to, $subject, $msg,"From: " . $Fname . $Lname);
$confirm = "Thank you for contacting us! Please allow 48 hours for a representative to respond. Click <a href='contact.php'>here</a> to return to the previous page.";
?>
这是 HTML 表单代码:
<form id="form1" name="form1" method="post" action="send.php">
<tr>
<label><td width="160px" class="labels">First Name: </td>
<td class="input"><input type="text" name="Fname" id="Fname"/></td>
</label>
</tr>
<tr>
<label><td class="labels">Last Name: </td>
<td class="input"><input type="text" name="Lname" id="Lname"/></td>
</label>
</tr>
<tr>
<label><td class="labels">Email: </td>
<td class="input"><input type="email" name="email" id="email"/></td>
</label>
</tr>
<tr>
<label><td class="labels">Message: </td>
<td class="input"><textarea name="message" id="message" cols="30" rows="5"></textarea></td>
</label>
</tr>
<tr>
<td class="labels"><input type="submit" name="submit" id="submit" value="Submit"/></td>
</tr>
</form>
任何帮助将不胜感激