###前提・実現したいこと
php初心者で全くわかりません。
しょうもない質問かもしれませんが、教えて頂けると幸いです。
phpでformを活用し、お問い合わせを作りたい。
■ 作成ページ
http://ones-create.net/recruit/
■ 参考ページ
https://heysho.com/phpcontact/
###発生している問題・エラーメッセージ
サーバー:GMO
FAILED to query 〇〇〇〇@gmail.com for your account. Please create formail account in the navi for your account. X-Powered-By: PHP/5.5.38 Content-type: text/html <script language="javascript" type="text/javascript"> alert('繝。繝�そ繝シ繧ク騾∽ソ。縺ォ螟ア謨励@縺セ縺励◆縲ゅ%縺。繧峨�繝。繝シ繝ォ繧「繝峨Ξ繧ケ縺ク縺雁撫縺�粋繧上○縺上□縺輔>縲〇〇〇〇@gmail.com'); window.location = 'http://ones-create.net/'; </script>
###該当のソースコード
【index.php】 <form role="form" action="recruit.php" method="post"> <div class="MainVisionInner"> <table class="PageContentRecruit"> <tr> <th><label>お名前</label></th> <td><input type="text" name="name" placeholder="例 ワンズクリエイト" required></td> </tr> <tr> <th><label>生年月日</label></th> <td><input type="text" name="birth" placeholder="例 1111年1月1日" required></td> </tr> <tr> <th><label>メールアドレス</label></th> <td><input type="email" name="email" placeholder="例 info@ones-create.net" required></td> </tr> <tr> <th><label>電話番号</label></th> <td><input type="tel" name="tel" placeholder="例 000-0000-0000" required></td> </tr> </table> </div> <div class="MainVisionSubmit"> <input type="submit" value="送信する" class="btn btn-default"> </div> </form>
【recruit.php】 <?php $field_name = $_POST['name']; $field_birth = $_POST['birth']; $field_email = $_POST['email']; $field_tel = $_POST['tel']; $mail_to = '〇〇〇〇@gmail.com'; $subject = 'Message from a site visitor '.$field_name; $body_message = 'From: '.$field_name."\n"; $body_message .= 'Birth: '.$field_birth."\n"; $body_message .= 'E-mail: '.$field_email."\n"; $body_message .= 'Tel: '.$field_tel; $headers = 'From: '.$field_email."\r\n"; $headers .= 'Reply-To: '.$field_email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); if ($mail_status) { ?> <script language="javascript" type="text/javascript"> window.location = 'http://ones-create.net/recruit/thanks.php'; </script> <?php } else { ?> <script language="javascript" type="text/javascript"> alert('メッセージ送信に失敗しました。こちらのメールアドレスへお問い合わせください。〇〇〇〇@gmail.com'); window.location = 'http://ones-create.net/'; </script> <?php } ?>
###試したこと
メールアドレスを変更などを試したが、効果がありませんでした。
wordpressを活用しているのですが、バージョンも最新にしました。
###補足情報(言語/FW/ツール等のバージョンなど)
php初心者で全くわかりません。
しょうもない質問かもしれませんが、教えて頂けると幸いです。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。