blog1

「お名前」を入力してください

“;
}
if (!$_REQUEST[“メールアドレス"]) {
$msg[“メールアドレス"] = “

「メールアドレス」を入力してください

“;
}
if (!$_REQUEST[“お問い合わせ詳細"]) {
$msg[“お問い合わせ詳細"] = “

「お問い合わせ詳細」を入力してください

“;
}
}
}
if ($mode == “reinput") {
$mode = “form";
}
if ($mode == “finish") {
$from_name = “サンプル株式会社";
$mail_from ="murasakihime@outlook.jp"; // 送信者のメールアドレス
$mail_to = “murasakihime@outlook.jp"; // 管理者のメールアドレス
$mail_subject = “お問い合わせありがとうございます";
$body = "
お問い合わせ有難うございました。

お名前:{$_REQUEST[“お名前"]}
メールアドレス:{$_REQUEST[“メールアドレス"]}
お問い合わせ詳細:{$_REQUEST[“お問い合わせ詳細"]}
“;
// 問い合わせをした人へ
sendmail($mail_from, $_REQUEST[“メールアドレス"], $mail_subject, $body, $from_name);
// 管理人へ
sendmail($mail_from, $mail_to, $mail_subject, $body);
}
} else {
$mode = “form";
}
?>

お名前※“>
" . $msg[“お名前"]; ?>
メールアドレス※“>
" . $msg[“メールアドレス"]; ?>
お問い合わせ詳細※
" . $msg[“お問い合わせ詳細"]; ?>


“>
“>
“>

お名前※
メールアドレス※
お問い合わせ詳細※


ありがとうございました。

“;
} else {
$header = “From: " . $mail_from;
}
// 返信先指定
if ($reply) {
$header .= “\r\nReply-to: <" . $reply . ">“;
}
// 漢字コードの指定
if (MAIL_ENCODING == “UTF8") {
$header .= “\r\nContent-Type: text/plain;\r\n\tformat=flowed;\r\n\tcharset=\"utf-8\";\r\n\treply-type=original";
} else {
$header .= “\r\nContent-Type: text/plain;\r\n\tcharset=\"iso-2022-jp\"\r\nContent-Transfer-Encoding: 7bit";
}
// 件名の変換
$subject_str = ";
while ($mail_subject) {
if ($subject_str) {
$subject_str .= “\r\n\t";
}
if (mb_strlen($mail_subject, SCRIPT_ENCODING) < 20) { if (MAIL_ENCODING == "UTF8") { $subject_str .= '=?utf-8?B?'; } else { $subject_str .= '=?iso-2022-jp?B?'; } $subject_str .= base64_encode(mb_convert_encoding($mail_subject, MAIL_ENCODING, SCRIPT_ENCODING)) . '?='; $mail_subject = ''; } else { if (MAIL_ENCODING == "UTF8") { $subject_str .= '=?utf-8?B?'; } else { $subject_str .= '=?iso-2022-jp?B?'; } $subject_str .= base64_encode(mb_convert_encoding(mb_substr($mail_subject, 0, 20, SCRIPT_ENCODING), MAIL_ENCODING, SCRIPT_ENCODING)) . '?='; $mail_subject = mb_substr($mail_subject, 20, mb_strlen($mail_subject, SCRIPT_ENCODING) - 20, SCRIPT_ENCODING); } } if (defined("LFONLY")) { $body = str_replace("\r", "", $body); $header = str_replace("\r", "", $header); } // 送信処理 return mail($mail_to, $subject_str, mb_convert_encoding($body, MAIL_ENCODING, SCRIPT_ENCODING), $header); }