为客户建立网站但联系表无法正常工作,我为客户设置了一个电子邮件帐户“contact@eunicedcolvin.co.uk”,但它似乎没有完成发送以加载成功消息,这是下面的代码。我对 PHP 相当陌生,但无法弄清楚问题所在。
<div id="contact-form" style="background: none;">
<div id="contact-header"></div>
<div id="contact-middle">
<?php
if ($_POST["email"]<>'') {
$ToEmail = 'contact@eunicedcolvin.co.uk';
$EmailSubject = 'Website Contact';
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$MESSAGE_BODY = "Name: ".$_POST["name"]."<br>";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>";
$MESSAGE_BODY .= "Comment: ".n12br($_POST["comment"])."<br>";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
?>
<div id="contact-success">
<span style="font-size:16px; font-weight:bold; ">Thanks! Your message was sent</span><br>
I will get back to you as soon as I can
</div>
</div>
<?php
} else {
?>
<form method="POST">
<table width="360" border="0" cellspacing="8" cellpadding="0" style="margin-left: 11px;">
<tbody><tr>
<td class="contact-label">Your name:<br></td>
<td class="contact-text-border"><input name="name" type="text" id="name" size="32" class="contact-name"></td>
</tr>
<tr>
<td class="contact-label">Your Email address:</td>
<td class="contact-text-border"><input name="email" type="text" id="email" size="32" class="contact-name"></td>
</tr>
<tr>
<td class="contact-label">Comment:</td>
<td class="contact-text-border" style="padding: 2px 2px;"><textarea name="comment" cols="45" rows="6" id="comment" class="contact-comment"></textarea></td>
</tr>
<tr>
<td height="33" class="contact-label"> </td>
<td align="left" valign="top">
<input type="submit" name="Submit" class="submit" value="."></td>
</tr>
</tbody></table>
</form>
<?php
};
?>
</div>
<div id="contact-bottom"></div>
</div>
</div>
如果您想现场观看它的样本,请点击此处:http ://www.eunicedcolvin.co.uk/contact.html
问题是,最初它被设置为发布到我的个人电子邮件中进行测试,然后当我将它交换过来时它拒绝工作!一段时间以来一直在为此绞尽脑汁:S