if(empty($arResult["ERROR_MESSAGE"]))
{
$arFields = Array(
"AUTHOR" => $_POST["user_name"],
"AUTHOR_EMAIL" => $_POST["user_email"],
"PHONE" => $_POST["user_phone"],
"EMAIL_TO" => $arParams["EMAIL_TO"],
"TEXT" => $_POST["MESSAGE"],
"FILE_NAME" => $_FILES['file']['name']
);
if(!empty($arParams["EVENT_MESSAGE_ID"]))
{
foreach($arParams["EVENT_MESSAGE_ID"] as $v)
if(IntVal($v) > 0)
CEvent::Send($arParams["EVENT_NAME"], SITE_ID, $arFields, "N", IntVal($v));
CEvent::Send($arParams["EVENT_NAME"], SITE_ID, $arFields, "N", IntVal($v), $file_array);
}
else
CEvent::Send($arParams["EVENT_NAME"], SITE_ID, $arFields,"","49");
CEvent::Send($arParams["EVENT_NAME"], SITE_ID, $arFields,"","7",$file_array);
$_SESSION["MF_NAME"] = htmlspecialcharsbx($_POST["user_name"]);
$_SESSION["MF_EMAIL"] = htmlspecialcharsbx($_POST["user_email"]);
$_SESSION["MF_PHONE"] = htmlspecialcharsbx($_POST["user_phone"]);
LocalRedirect($APPLICATION->GetCurPageParam("success=".$arResult["PARAMS_HASH"], Array("success")));
}