/**
 * mail txt message from template
 * @param string email
 * @param string email subject
 * @param string template name
 */
function xMailTxt($_Email, $_Subject, $_TemplateName, $_AssignArray = array(), $html = false)
{
    if (!$_Email) {
        return 0;
    }
    $mailSmarty = new ViewSC();
    foreach ($_AssignArray as $_var => $_val) {
        $mailSmarty->assign($_var, $_val);
    }
    $_t = $mailSmarty->fetch('email/' . $_TemplateName);
    ss_mail($_Email, $_Subject, $_t, true);
}
        Message::raiseMessageRedirectSQ(MSG_ERROR, '#product-request', 'msg_error_wrong_email', '', array('name' => 'prd_request', 'prd_request' => $_POST));
    }
    //validate input data
    if ($customer_email && $customer_name && $message_subject && $message_text && valid_email($customer_email)) {
        if (CONF_ENABLE_CONFIRMATION_CODE) {
            $iVal = new IValidator();
            if (!$iVal->checkCode($_POST['fConfirmationCode'])) {
                Message::raiseMessageRedirectSQ(MSG_ERROR, '#product-request', 'err_wrong_ccode', '', array('name' => 'prd_request', 'prd_request' => $_POST));
            }
        }
        $customer_name = str_replace(array('@', '<', "\n"), array('[at]', '', ''), $customer_name);
        $customer_email = str_replace(array("\n", '<'), '', $customer_email);
        $message_text = "{$customer_name} ({$customer_email}):\n{$message_text}";
        $headers = array('From' => $customer_email, 'Sender' => $customer_email, 'FromName' => $customer_name);
        //send a message to store administrator
        ss_mail(CONF_GENERAL_EMAIL, $message_subject, $message_text, false, $headers);
        RedirectSQ('sent=yes#product-request');
    } elseif (isset($_POST["request_information"])) {
        Message::raiseMessageRedirectSQ(MSG_ERROR, '#product-request', 'err_input_all_required_fields', '', array('name' => 'prd_request', 'prd_request' => $_POST));
    }
}
//show product information
if (isset($productID) && $productID >= 0 && !isset($_POST["add_topic"]) && !isset($_POST["discuss"])) {
    $product = GetProduct($productID);
    if (!$product || $product["enabled"] == 0) {
        error404page();
        //RedirectSQ('?');
    } else {
        if (!isset($_GET["vote"])) {
            IncrementProductViewedTimes($productID);
        }