前提・実現したいこと
問い合わせしてくれた人(ユーザー)へサンクスメールの送信、管理者へは入力された情報をメールで受信したい。
発生している問題・エラーメッセージ
htmlでの構築段階では特に問題なく送受信ができていたのですが、WordPressに移行後完了ページに遷移してもメールが届かなくなってしまいました。
サーバーは担当者がAWSを一から構築して使用しおります。
入力フォーム画面・送信内容確認画面・完了画面は全て固定ページにしており、画面遷移はうまく行っています。
コードに記述ミスがあるのか、サーバー側で何か設定しないといけないのか...何が原因なのか分かりません。
php初心者、サーバー知識はあまりないですが宜しくお願い致します。
該当のソースコード
php
1【送信完了画面 2:mail.php】 3<?php header("Content-Type:text/html;charset=utf-8"); ?> 4 5<?php 6$action = $_POST['action']; 7$firstname = htmlspecialchars($_POST['firstname']); 8$lastname = htmlspecialchars($_POST['lastname']); 9$first_f_name = htmlspecialchars($_POST['first_f_name']); 10$last_f_name = htmlspecialchars($_POST['last_f_name']); 11$company = htmlspecialchars($_POST['company']); 12$sex = htmlspecialchars($_POST['sex']); 13$age = htmlspecialchars($_POST['age']); 14$type = htmlspecialchars($_POST['type']); 15$send = htmlspecialchars($_POST['send']); 16$zip11 = htmlspecialchars($_POST['zip11']); 17$addr11 = htmlspecialchars($_POST['addr11']); 18$address = htmlspecialchars($_POST['address']); 19$tel = htmlspecialchars($_POST['tel']); 20$email = htmlspecialchars($_POST['email']); 21$comment = htmlspecialchars($_POST['comment']); 22$privacy_check = htmlspecialchars($_POST['privacy_check']); 23 24/* 管理者用 */ 25$to = 'test@test.co.jp'; 26$subject = '資料請求'; 27$message .= '◆https://sample.com/'."\n\n"; 28$message .= '[お名前]'."\n".$firstname .$lastname."\n\n"; 29$message .= '[フリガナ]'."\n".$first_f_name .$last_f_name."\n\n"; 30$message .= '[勤務先]'."\n".$company."\n\n"; 31$message .= '[性別]'."\n".$sex."\n\n"; 32$message .= '[年齢]'."\n".$age."歳"."\n\n"; 33$message .= '[資料の受取方法]'."\n".$type."\n\n"; 34$message .= '[希望の送付先]'."\n".$send."\n\n"; 35$message .= '[住所]'."\n"."〒".$zip11."\n".$addr11.$address."\n\n"; 36$message .= '[電話番号]'."\n".$tel."\n\n"; 37$message .= '[メールアドレス]'."\n".$email."\n\n"; 38$message .= '[お問い合わせ内容]'."\n".$comment."\n\n"; 39$header = 'From: '.$email."\r\n"; 40$header .= 'Reply-To: '.$email."\r\n"; 41 42/* 申し込み者用 */ 43$mailto = $email; 44$subject2 = '資料のご請求ありがとうございます。'; 45$message2 .= 46 '※本メールは自動配信です。送信専用の為、ご返信いただいてもお答えできません。ご了承ください。' 47 ."\n".'お問い合わせは本メールに記載の連絡先へご連絡いただきますようお願い申し上げます。' 48 ."\n\n\n".$firstname .$lastname.'様、この度は資料請求ありがとうございます。' 49 ."\n\n".'- ▼ 送 信 内 容 - - - - - - -' 50 ."\n".'[お名前] '.$firstname .$lastname 51 ."\n".'[フリガナ] '.$first_f_name .$last_f_name 52 ."\n".'[勤務先] '.$company 53 ."\n".'[性別] '.$sex 54 ."\n".'[年齢] '.$age."歳" 55 ."\n".'[資料の受取方法] '.$type 56 ."\n".'[住所] '."〒".$zip11."\n".$addr11.$address 57 ."\n".'[電話番号] '.$tel 58 ."\n".'[メールアドレス] '.$email 59 ."\n".'[お問い合わせ内容] '."\n".$comment 60 ."\n\n".'- ▼ 資料のダウンロードはこちら - - - - - - -' 61 ."\n".'ダウンロード用URL記載' 62 ."\n".'- - - - - - - - - - - - - - - - - - - - - - - - -' 63 ."\n\n\n".'郵送をご希望のお客様は、到着までに3日ほどお時間いただきます。ご了承ください。' 64 ."\n\n".'ご不明点等ございましたらお気軽にお問い合わせください。' 65 ."\n\n\n".'https://sample.com/' 66 ."\n".'TEL:00-0000-0000 info@sample.co.jp'; 67 68$header2 = 'From: '.$to."\r\n"; 69 70if($action == "post") 71$status = mb_send_mail($to, $subject, $message,$header); 72if($action == "post") 73$status = mb_send_mail($mailto, $subject2,$message2,$header2); 74?>
回答4件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/08/18 08:34
退会済みユーザー
2020/08/18 09:14
2020/08/18 10:08