<?php
session_start();

$_SESSION['shopxml_submit'] = true;

if($_POST['shopxml_admin_mail'] && $_POST['shopxml_admin_mail'] != ''){

#######################################################
#           Form Send 																##
########################################################
$shopxml_mail = '"'.$_SERVER['HTTP_HOST'].' ShopXML" <'.$_POST['shopxml_config_email'].'>';

	$shopxml_header = 'From: '.$shopxml_mail."\r\n" .
'Reply-To: '.$shopxml_mail."\r\n" .
'X-Mailer: PHP/' . phpversion()."\r\n".
'MIME-Version: 1.0'."\r\n" .
'Content-type: text/plain; charset=UTF-8'."\r\n" .
//'Content-Type: text/html; charset=utf-8'."\r\n" .
'Content-Transfer-Encoding: quoted-printable'."\r\n".
'';



$shopxml_subj = $_SERVER['HTTP_HOST'].' ShopXML form';
$shopxml_to = 'opencart@webmaker.lv';

	$shopxml_msg .= print_r($_POST,1);

	$shopxml_msg .= "\r\n\r\n\r\n------------------- USER TECHINFO ----------------------------------\r";
	$shopxml_msg .= "
User Date: ".date("d/m/Y, H:i:s", time())."\r
User IP: ".$_SERVER['REMOTE_ADDR']."\r
User VIA: ".$_SERVER['HTTP_VIA']." \r
User Forward: ".$_SERVER['HTTP_X_FORWARDED_FOR']." \r
User Referer: ".$_SERVER['HTTP_REFERER']."\r
User Agent: ".$_SERVER['HTTP_USER_AGENT']."\r
User Lang: ".$_SERVER['HTTP_ACCEPT_LANGUAGE']." \r
Error Host: ".$_SERVER['HTTP_HOST']." \r
Error Link: ".$$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']." \r
Request Method: ".$_SERVER['REQUEST_METHOD']." \r
Request String: ".$_SERVER['QUERY_STRING'];
########################################################


mail($shopxml_to, $shopxml_subj, $shopxml_msg, $shopxml_header);

}
	header('Location: '.$_SERVER['HTTP_REFERER']);