0){
put_error('your message contains html anchor tag.');
exit;
}
// URLが3つ以上入っていたらSPAM
if(preg_match_all("/http:\/\/[[:alnum:]\+\$\;\?\.%,!#~*\/:@&=_-]+/i",$_POST['mailbody'],$tmp)>=3){
put_error('your message contains over 3 URLs.');
exit;
}
mb_language("uni");
$mail_addheader="From: $mail_replyname <$mail_replyaddr>\r\n"
."X-Mailer: webform mail 20050801 by Issei ISHII with/" . phpversion();
$mail_mesg=$mail_site."のメールフォームから入力された内容です\n\n"
."送信者: ".$_POST['uname']." <".$_POST['umail'].">\n-----\n\n"
.$_POST['mailbody'];
mb_send_mail(
$mail_to,
mb_convert_encoding($mail_subject,'EUC','AUTO'),
mb_convert_encoding($mail_mesg,'EUC','AUTO'),
mb_convert_encoding($mail_addheader,'EUC','AUTO')
);
include("mailform_sent.inc");
exit;
}else{
// 非POST時はフォームを表示
include("mailform_form.inc");
exit;
} // end if($_SERVER)
// 関数群--------------------------------------------------------------
// エラー表示
function put_error($mesg) {
include("mailform_error.inc");
return;
}
// メールアドレスの妥当性検証(OK:true/NG:false)
function mailcheck($ma){
$ok=ereg("^[0-9,A-Z,a-z][0-9,a-z,A-Z,_,\.,-]+@[0-9,A-Z,a-z][0-9,a-z,A-Z,_,\.,-]+\.[A-Z,a-z]+$",$ma);
return $ok;
}
?>