$emailData['Numéro de téléphone'] = $_POST['phone'];
    $emailData['Message'] = $massage;
    $emailData["Vous avez reçu un e-mail à partir d'ici"] = DEFAULT_URL . "/nosstock/";
    $message = emailContentsWrapper($emailData, $heading, $subHeading);
    $adminEmails = $common->getAdminNotificationEmails();
    foreach ($adminEmails as $emaiA) {
        $sentmail = sendSmtpMail($emaiA, $subject, $message);
    }
    $heading = 'Merci';
    $subHeading = 'Vous ajoutez une voiture à votre sélection avec les détails suivants.';
    $footerHeading = 'Merci encore<br/>Americamcarcentrale.com';
    $emailData = null;
    $emailData['Nom'] = $_POST['name'];
    $emailData['Adresse e-mail'] = $_POST['email'];
    $emailData['Numéro de téléphone'] = $_POST['phone'];
    $message = emailContentsWrapper($emailData, $heading, $subHeading, $footerHeading);
    sendSmtpMail($_POST['email'], 'Merci', $message);
    ?>
       <script src="<?php 
    echo DEFAULT_URL;
    ?>
/js/jquery.min.js" type="text/javascript"></script>
       <script type="text/javascript">
			$ = jQuery.noConflict();	
		</script>
        <script src="<?php 
    echo DEFAULT_URL;
    ?>
/js/jquery.msgBox.js" type="text/javascript"></script>
        <link href="<?php 
    echo DEFAULT_URL;
    $emailData['vin'] = $item->vin;
    $emailData['Achat immédiat Prix'] = $common->CurrencyConverter($item->buyItNowPrice) . ' &euro;';
    $emailData['Construire'] = $item->Make;
    $emailData['Modèle'] = $item->Model;
    $emailData['Kilométrage'] = number_format($item->Mileage, 2) . ' Mi';
    $emailData["Vous avez reçu un e-mail à partir d'ici"] = DEFAULT_URL . "/announces";
    $message = emailContentsWrapper($emailData, $heading, $subHeading);
    //$message = html_entity_decode(htmlentities($message, ENT_NOQUOTES, "UTF-8"));
    $adminEmails = $common->getAdminNotificationEmails();
    foreach ($adminEmails as $email) {
        sendSmtpMail($email, $subject, $message);
    }
    // Send confirmation to User
    $heading = 'Merci';
    $subHeading = 'Votre demande a bien été reçue.<br><br>Merci encore<br/>Americamcarcentrale.com';
    $message = emailContentsWrapper(null, $heading, $subHeading);
    sendSmtpMail($_POST['email'], 'Merci', $message);
    $_SESSION['sentmail_txt'] = '<script src="' . DEFAULT_URL . '/js/jquery.msgBox.js" type="text/javascript"></script>
   <link href="' . DEFAULT_URL . '/css/msgBoxLight.css" rel="stylesheet" type="text/css">
   <script type="text/javascript">
	   $(document).ready(function(){
		   $.msgBox({
			   title:"Merci",
			   content:"Nous avons ajouté votre demande avec succès",
			   type:"info",
			   timeOut:3000,
			   opacity:0.9,
			   autoClose:true
		   });
	   });
	   </script>';
 $headers = 'MIME-Version: 1.0' . "\r\n";
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "<br/>";
 // Additional headers
 $headers .= 'From: ' . $_POST['name'] . '<' . $_POST['email'] . '>' . "<br/>";
 $message .= emialHeading('Vous avons reçu une nouvelle index page  enquête');
 $message .= emailContentsHeading('Les détails sont comme ci-dessous:');
 $emailData['nom'] = $_POST['name'];
 $emailData['Prénom'] = $_POST['prename'];
 $emailData['E-mail'] = $_POST['email'];
 $message .= emailContents($emailData);
 $message .= emailContentsHeading('information de la recherche:');
 $message .= emailContents($searchData);
 $emailData = null;
 $emailData["Vous avez reçu un e-mail à partir d'ici "] = DEFAULT_URL;
 $message .= emailContents($emailData);
 $message = emailContentsWrapper($message);
 $dataArray = array('name' => $name . " " . $prename, 'email' => $email, 'phone' => $phone, 'message' => $massage, 'type' => 101, 'mail_date' => $currentTimestamp);
 $password = base64_encode(trim($password));
 $userData = array('firstname' => $name, 'name' => mysql_real_escape_string($prename), 'email' => mysql_real_escape_string($email), 'phone_number' => mysql_real_escape_string($phone), 'password' => $password, 'created' => date('Y-m-d H:i:s'));
 $saveUsr = $common->save("users", $userData);
 if ($saveUsr) {
     // send enquiry to admin ...
     $common->save("contact", $dataArray);
     //Send email notification.
     sendSmtpMail($email, 'Merci', 'Votre demande de contact a été reçu avec succès.');
     $adminEmails = $common->getAdminNotificationEmails();
     foreach ($adminEmails as $emailA) {
         sendSmtpMail($emailA, $subject, $message);
     }
     $userqrywhrcondition = "email='" . trim($email) . "' AND password = '******'";
     $user = $common->read("users", $userqrywhrcondition);