在我们开始之前,我是一个完整的新手!
我已经使用PHP创建了一个联系表单。我已将代码嵌入到我的电子邮件html中并更改了php文件中的电子邮件地址。
创建它的人说它在他们的服务器上工作正常,并已发送电子邮件证明它。
点击提交后,电子邮件会通过但是空白,有任何想法吗?
PHP代码(文件名simple-mailprocess_v2
):
<?
$to= ('info@cre8ivo.co.uk');
$subjectline= ('Website - form enquiry - Speak to a private medical insurance specialist');
$thanks=('thankyou.html');
$return=('Location:'.$thanks);
if (sizeof($_POST)) {
$body = "";
while(list($key, $val) = each($HTTP_POST_VARS)) {
$body .= "$key: \n $val \n\n";
// Check if all fields have been filled in
if(empty($val)) {
echo ("<b><li>either one or more required fields have not been completed. Go <a href='javascript: history.go(-1)'>Back</a> and try again</li></b>");
exit();
}
}
}
// Secure the headers
$security = "From: \r\n";
$security .= "Reply-To: \r\n";
$security .= "Return-Path: \r\n";
$security .= "CC: \r\n";
$security .= "BCC: \r\n";
// Send the email.
if ( mail($to,$subjectline,$body,$security) ) {
header($return);
} else {
echo "The email has failed!";
}
?>
非常感谢任何帮助!
我需要提供更多信息,不确定需要什么抱歉!
非常感谢, 简