Сломалась форма обратной связи.
Если не заполнять поле с "мылом" то письма приходят.
Как поле "мыло" заполнишь-тишина.
Выложу код,сорри если корявый..сделано в конструкторе.
<?php
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['formid']) && $_POST['formid'] == 'indexform1')
{
$mailto = 'сюда_письма_приходят@ya.ru';
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$subject = 'Website form';
$message = 'Values submitted from web site form:';
$success_url = '';
$error_url = '';
$error = '';
$eol = "\n";
$max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000;
$boundary = md5(uniqid(time()));
$header = 'From: '.$mailfrom.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address is invalid!\n<br>";
}
if (!empty($error))
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $error, $errorcode);
echo $errorcode;
exit;
}
$internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response");
$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
$logdata = '';
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=UTF-8'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize)
{
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
$body .= 'Content-Transfer-Encoding: base64'.$eol;
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
}
}
}
$body .= '--'.$boundary.'--'.$eol;
if ($mailto != '')
{
mail($mailto, $subject, $body, $header);
}
header('Location: '.$success_url);
exit;
}
?>
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>form</title>
<link href="wwb-css/10.4.css" rel="stylesheet">
<link href="wwb-css/index.css" rel="stylesheet">
<script>
function Validateформа1(theForm)
{
var regexp;
regexp = /^[a-z,A-Z,а-я,А-Я]*$/;
if (!regexp.test(theForm.indexEditbox1.value))
{
alert("Please enter only letter characters in the \"Имя\" field.");
theForm.indexEditbox1.focus();
return false;
}
regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
if (theForm.indexEditbox2.value.length != 0 && !regexp.test(theForm.indexEditbox2.value))
{
alert("Мыло не ввел");
theForm.indexEditbox2.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<div id="container">
<div id="wb_indexForm1" style="position:absolute;left:361px;top:16px;width:249px;height:277px;z-index:4;">
<form name="форма1" method="post" action="<?php echo basename(__FILE__); ?>" enctype="multipart/form-data" accept-charset="UTF-8" id="indexForm1" onsubmit="return Validateформа1(this)">
<input type="hidden" name="formid" value="indexform1">
<input type="text" id="indexEditbox1" style="position:absolute;left:58px;top:23px;width:130px;height:26px;line-height:26px;z-index:0;" name="Имя" value="" placeholder="Введите имя">
<textarea name="Сообщение" id="indexTextArea1" style="position:absolute;left:26px;top:140px;width:195px;height:57px;z-index:1;" rows="2" cols="29" placeholder="Пишем тут"></textarea>
<input type="submit" id="indexButton1" name="" value="Отправить" style="position:absolute;left:76px;top:225px;width:96px;height:25px;z-index:2;">
<input type="email" id="indexEditbox2" style="position:absolute;left:58px;top:77px;width:122px;height:18px;line-height:18px;z-index:3;" name="Мыло" value="" placeholder="Введите мыло">
</form>
</div>
</div>
</body>
</html>
P.S.
Кстати,на локалке "Open Server" все работает без проблем.
Ниче не понимаю.