IsSMTP();
$mail->Host = 'smtp3r.cp.idhost.kz';
$mail->Port = 25;
$mail->SMTPAuth = false;
$mail->Subject = stripslashes($subject);
$mail->From = $mailfrom;
$mail->FromName = $mailfrom;
$mailto_array = explode(",", $mailto);
$mailcc_array = explode(",", $mailcc);
$mailbcc_array = explode(",", $mailbcc);
for ($i = 0; $i AddAddress($mailto_array[$i], "");
}
}
for ($i = 0; $i AddCC($mailcc_array[$i], "");
}
}
for ($i = 0; $i AddBCC($mailbcc_array[$i], "");
}
}
$mail->AddReplyTo($mailfrom);
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address is invalid!\n
";
}
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");
$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
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;
}
}
}
$mail->CharSet = 'UTF-8';
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] AddAttachment($_FILES[$key]['tmp_name'], $_FILES[$key]['name']);
}
}
}
$mail->WordWrap = 80;
$mail->Body = $message;
if (!$mail->Send())
{
die('PHPMailer error: ' . $mail->ErrorInfo);
}
header('Location: '.$success_url);
exit;
}
?>