単純なphpメール連絡フォームが機能するのに問題があります。エラーは生成または返されませんが、電子メールを受信していません。
これは私のフォームですhttp://bitstream.ca/beta2/contact.html
そして私が使用しているphp(もちろん私の適切な電子メールで)
誰かが以下のフォームコードでエラーを見ることができますか?試すべき一般的なデバッグ手順は何ですか?前もって感謝します!
<?php
$errors = '';
$myemail = 'foo@foo.foo';//<-----Put Your email address here.
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']))
{
$errors .= "\n Error: all fields are required";
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z {2,3})$/i", $email_address))
{
$errors .= "\n Error: Invalid email address";
}
if( empty($errors))
{
header('Location: contact-form-thank-you.html');
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Contact form handler</title>
</head>
<body>
<!-- This page is displayed only if there is some error -->
<?php
echo nl2br($errors);
?>
</body>
</html>