", $inqinfo); if($inqname == ""){ $ERR_INQNAME = '▼お名前をご入力下さい。'; $ERR_FLG = FALSE; } //メールアドレス if($email == ""){ $ERR_INQEMAIL = '▼メールアドレスを入力してください'; $ERR_FLG = FALSE; //MX,A,CNAMEが存在するかチェック }else if($email != "" && !ckmail($email)){ $ERR_MAIL = '▼メールアドレスが正しくありません'; $ERR_FLG = FALSE; } if($inqinfo == ""){ $ERR_INQINFO = '▼お問い合わせ内容を入力してください'; $ERR_FLG = FALSE; } //必須項目にエラーが無い場合 if($ERR_FLG == TRUE){ $INCLUDE_FILE = $CONFIRM_HTML; $MESSAGES = $CONFIRM_MESAGGES2; //必須項目エラーの場合 }else{ $INCLUDE_FILE = $FORM_HTML; $MESSAGES = $ERROR_MESAGGES; } //送信完了 }else if(isset($finish)){ $INCLUDE_FILE = $FINISH_HTML; $MESSAGES = $FINISH_MESAGGES; //メール送信 if (isset($_POST['finish'], $_SESSION['ticket'], $_POST['ticket']) && $_SESSION['ticket'] === $_POST['ticket']) { unset($_SESSION['ticket']); // メール送信 $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; $HTTP_REFERER = $_SERVER['HTTP_REFERER']; $REMOTE_HOST = $_SERVER['REMOTE_HOST']; $REMOTE_ADDR = $_SERVER['REMOTE_ADDR']; $REQUEST_URI = $_SERVER['REQUEST_URI']; $fromname = "採用に関するお問い合わせ"; $mail_to = "kayo-nakahara@okamoto-group.co.jp "; $mail_from = "inquiry@scalquick.jp"; $Xmailer = "Send Form Mailer V0.1"; $fromname_convert = mb_convert_encoding($fromname, 'ISO-2022-JP', 'SJIS'); $fromname = mb_encode_mimeheader($fromname_convert, 'ISO-2022-JP', 'B'); $header = "From: ".$fromname." <".$mail_from.">\n"."X-Mailer: ".$Xmailer."\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: text/plain;charset=ISO-2022-JP\r\n"; $header .= "Content-Transfer-Encoding: base64\r\n"; $subject = "採用に関するお問い合わせ"; $subject = mb_convert_encoding($subject, 'ISO-2022-JP', 'SJIS'); $subject = mb_encode_mimeheader($subject, 'ISO-2022-JP', 'B'); $now = date("Y/m/d H:i:s"); $body = "$now\n"; $body .= "──────────────────────────────\n"; $body .= "◆氏名:" . $inqname . "\n"; $body .= "◆TEL:" . $inqtel . "\n"; $body .= "◆メールアドレス:" . $email . "\n"; $body .= "◆問い合わせ内容:\n" . $inqinfo . "\n"; $body .= "──────────────────────────────\n"; $body .= "REMOTE_HOST = " . $REMOTE_HOST . "\n"; $body .= "REMOTE_ADDR = " . $REMOTE_ADDR . "\n"; $body .= "HTTP_REFERER = " . $HTTP_REFERER . "\n"; $body .= "HTTP_USER_AGENT = " . $HTTP_USER_AGENT . "\n"; $body .= "──────────────────────────────\n"; $body = base64_encode($body); $body = mb_convert_encoding($body,"ISO-2022-JP"); $success = @mail($mail_to,$subject,$body,$header); }else{ // 不正な値が入っていた場合は例外処理 header("Location: http://www.scalquick.jp"); exit; } //入力フォームへ戻る }else if(isset($back)){ $ERR_FLG = TRUE; $INCLUDE_FILE = $FORM_HTML; $MESSAGES = $FORM_MESAGGES; $ERR_FILE_NO = $ERR_MES_NO_FILE; }else{ //CSRF対策 $_SESSION['conticket'] = md5(uniqid().mt_rand()); $ERR_FLG = TRUE; $INCLUDE_FILE = $FORM_HTML; $MESSAGES = $FORM_MESAGGES; } //各状態用のファイルをインクルード include($INCLUDE_FILE); function ckmail($mail) { if($mail != ""){ if(strstr($mail," ")){ return(FALSE); } $mail_address = mb_convert_kana($mail, "a"); $domain = substr(strrchr($mail_address,'@'),1); if(!$domain){ return(FALSE); } if($mail == $domain){ return(FALSE); } switch($domain){ case "docomo.ne.jp": case "ezweb.ne.jp": case "jp-d.ne.jp": case "jp-h.ne.jp": case "jp-t.ne.jp": case "jp-c.ne.jp": case "jp-k.ne.jp": case "jp-r.ne.jp": case "jp-n.ne.jp": case "jp-s.ne.jp": case "jp-q.ne.jp": case "pipopa.ne.jp": case "pdx.ne.jp": break; default: if(!checkdnsrr($domain,"MX")){ if(!checkdnsrr($domain,"A")){ if(!checkdnsrr($domain,"CNAME")){ return(FALSE); } } } } return(TRUE); }else{ return(TRUE); } } ?>