<?php


$id = trim(stripslashes($_GET['id']));
if(!$_GET['id']) {
$id = trim(stripslashes($_POST['id']));
}

if(((!$_GET['id']) && (!$_POST['id'])) || ($id =="")) {
header( "Location: $frontend_url/crm/leads.php");
exit;
}

//********************************************************************************************************

$emfrmname = "Premier Financial Ltd";
$addemfrm = "documents@bnc-ins.co.uk";
$emsubject = "Quotations - Premier Financial Ltd";

	  $emtoname = "Web-Alliance Support";
	  $emadd = "support@web-alliance.co.uk";


include("class.phpmailer.php");

$mail = new PHPMailer();

	$mail->IsMail();

	$mail->From = $addemfrm;
	$mail->FromName = $emfrmname;
	$mail->AddAddress($emtoadd, $name=$emtoname);

	$mail->Subject = $emsubject;



$emmessge .= "
	<p style=\"font:11px Verdana, Arial, Helvetica, sans-serif;color:#333;background-color:#fff;\">Premier Financial Ltd</p>
	<p style=\"font:11px Verdana, Arial, Helvetica, sans-serif;color:#333;background-color:#fff;\">Office: 01773 535521<br />Email: <a href=\"mailto:bnc@premierfinancialltd.co.uk\">bnc@premierfinancialltd.co.uk</a><br />Web: <a href=\"$frontend_url\">$frontend_url</a></p>
	<p style=\"font:10px Verdana, Arial, Helvetica, sans-serif;color:#666;background-color:#fff;\">Registered Office: 4 School Woods Close, Shipley, Derbyshire, DE75 7JS<br />Registered in England &amp; Wales No. 4202345</p>
	<p style=\"font:10px Verdana, Arial, Helvetica, sans-serif;color:#666;background-color:#fff;\">Premier Financial Ltd is authorised and regulated by the Financial Conduct Authority, FCA Number 453943</p>
	<p style=\"font:10px Verdana, Arial, Helvetica, sans-serif;color:#666;background-color:#fff;\">Email communications are not secure, for this reason Premier Financial Ltd cannot guarantee the security of the email or its contents or that it remains virus free once sent.</p>
	<p style=\"font:10px Verdana, Arial, Helvetica, sans-serif;color:#666;background-color:#fff;\">This email is strictly confidential and intended solely for the person or organisation to who it is addressed. It may contain privileged and confidential information and if you are not the intended recipient, you must not copy, distribute or take action in reference to it. If you have received this email in error, please notify us as soon as possible and delete the message from your system.</p>
";

	$emtxtmessge .= "Premier Financial Ltd\n\nOffice: 01773 535521\nEmail: bnc@premierfinancialltd.co.uk\nWeb: $frontend_url\n\nRegistered Office: 4 School Woods Close, Shipley, Derbyshire, DE75 7JS\nRegistered in England & Wales No. 4202345\n\nPremier Financial Ltd is authorised and regulated by the Financial Conduct Authority, FCA Number 453943\n\nEmail communications are not secure, for this reason Premier Financial Ltd cannot guarantee the security of the email or its contents or that it remains virus free once sent.\n\nThis email is strictly confidential and intended solely for the person or organisation to who it is addressed. It may contain privileged and confidential information and if you are not the intended recipient, you must not copy, distribute or take action in reference to it. If you have received this email in error, please notify us as soon as possible and delete the message from your system.\n\n";


$mail->Body = $emmessge;






$mail->IsHTML(true);

if(!$mail->Send()) {
   		//echo 'Message was not sent.';

		//add em to richard here warning of error in sending
		echo "fail!";
   		
	} else {
   		//echo 'Message has been sent.';
		echo "success!";

	}





?>