始める前はまったくの初心者です!
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!";
}
?>
どんな助けでも大歓迎です!
それ以上の情報が必要な場合は、私が提供します。何が必要かわかりません。申し訳ありません!
どうもありがとう、ジェーン。