<?php

	$mail_to = "patrice.delpy@neuf.fr"; //Destinataire  
	$from_mail = "patrice.delpy@neuf.fr"; //Expediteur  
	$from_name = "Nom"; //Votre nom, ou nom du site  
	$reply_to = "patrice.delpy@neuf.fr"; //Adresse de réponse  
	$subject = "Prise de contact:";      
	$file_name = "word.doc";  
	//$path = $_SERVER['DOCUMENT_ROOT']."";  
	//$typepiecejointe = filetype($file_name);  
	$data = chunk_split( base64_encode(file_get_contents($file_name)) );  
	//Génération du séparateur  
	$boundary = md5(uniqid(time()));  
	$entete = "From: $from_mail \n";  
	$entete .= "Reply-to: $from_mail \n";  
	$entete .= "X-Priority: 1 \n";  
	$entete .= "MIME-Version: 1.0 \n";  
	$entete .= "Content-Type: multipart/mixed; boundary=\"$boundary\" \n";  
	$entete .= " \n";  
	$message  = "--$boundary \n";  
	//$message .= "Content-Type: text/html; charset=\"iso-8859-1\" \n";  
	$message .= "Content-Type: text/html; charset=\"UTF-8\" \n";  
	$message .= "Content-Transfer-Encoding:8bit \n";  
	$message .= "\n";  
/*$message .= "Bonjour,  
Veuillez trouver ci-joint le bon de commande  
Cordialement";  */
$message .= '<html><head>
    <meta content="text/html; charset=windows-1252" http-equiv="content-type">
    <title> Confirmation Reservation </title>
  </head>
  <body>
    <table style="width: 664px; background-color: lightskyblue;" border="1">
      <tbody>
	  
        <tr>
          <td style="background-color: lightskyblue; height: 169.55px;" colspan="3" rowspan="1">
		  <span style="color: #3333ff;">
		  <img src="http://www.analog-design.net/WORKAREA/WEBSITE/Location site/Location_17_11_2014//img/plage.jpg" alt="" width="99%" height="200"  title="Bonne anse" align="middle">
		  
		  </span>
		  </td>
        <td>
            <div style="text-align: left;">
              <h2 style="background-color: lightskyblue;">
			  <span style="color: #2828ca;">
			  <span style="font-style: italic;">
			  <span style="font-weight: bold;">Bonne Anse Plage</span>
			  </span>
			  </span></h2>
            </div>
            <div align="center">Location MobilHome <span style="text-decoration: underline;"><br>
            </span></div></td>
        </tr>
        <tr align="center">
          <td colspan="4" rowspan="1" valign="middle" style="height: 66.8333px;">
            <h2>Confirmation de votre r&eacute;servation </h2>
          </td>
        </tr>
        <tr>
          <td style="width: 148.35px;"><span style="font-weight: bold;"> Nom</span></td>
          <td style="height: 20px;" colspan="3" rowspan="1">';
		  $message.= $nom;
		  $message.= '
		  <br>
          </td>
        </tr>
        
        <tr>
          <td><strong>Pr&eacute;nom</strong><br>
          </td>
          <td colspan="3" rowspan="1">';
		  $message.= $prenom;
		  $message.= '
		  <br>
          </td>
        </tr>
             
         <tr>
          <td><strong>T&eacute;l&eacute;phone</strong><br>
          </td>
          <td colspan="3" rowspan="1">';
		  $message.= $tel;
		  $message.= '
		  <br>
          </td>
        </tr>    
             
         <tr>
          <td><strong>Email</strong><br>
          </td>
          <td colspan="3" rowspan="1">';
		  $message.= $email;
		  $message.= '
		  <br>
          </td>
        </tr>    
        
        <tr>
          <td><strong>Jour d\'arrivée</strong><br>
          </td>
          <td>';
		  $message.= $date1;
		  $message.= '
		  <br>
          </td>
          <td><strong>Heure d\'arrivée</strong><br>
          </td>
          <td>';
		  $message.= "Aprés4H";
		  $message.= '
		  <br>
          </td>
        </tr>
		
        <tr style="height: 23px;">
          <td><strong>Jour de départ</strong><br>
          </td>
          <td>';
		  $message.= $date2;
		  $message.= '
		  <br>
          </td>
          <td><strong>Heure du départ</strong><br>
          </td>
          <td>';
		  $message.= "Avant 12H";
		  $message.= '
		  <br>
          </td>
        </tr>
		
		 <td><strong>Nombre de personne</strong><br>
          </td>
          <td colspan="3" rowspan="1">';
		  $message.= $nb_personne;
		  $message.= '
		  <br>
          </td>
		
        <tr>
          <td><strong></strong></td>
          <td><br>
          </td>
          <td><strong></strong></td>
          <td><br>
          </td>
        </tr>
        <tr>
          <td><strong></strong></td>
          <td colspan="3" rowspan="1"><br>
          </td>
        </tr>
        <tr>
          <td><strong></strong></td>
          <td colspan="3" rowspan="1"><br>
          </td>
        </tr>
        <tr>
          <td><strong></strong></td>
          <td colspan="3" rowspan="1"><br>
          </td>
        </tr>
        <tr>
          <td><strong></strong></td>
          <td colspan="3" rowspan="1"><br>
          </td>
        </tr>
        <tr>
          <td colspan="4" rowspan="1">
            <div style="text-align: center;"><strong><span style="text-decoration: underline;">*Procédure</span>*</strong></div>
            <ul>
              <li>Vous trouverez le contrat de location en piéce jointe.</li>
              
              
            </ul>
            Cordialement,<br>
            <br>
            <br>
            Pour me contacter: <br>
            patrice.delpy@free.fr</td>
        </tr>
      </tbody>
    </table>
    <p><br>
    </p>
  

</body></html>	';


	$message .= "\n";  
	$message .= "--$boundary \n";  
	$message .= "Content-Type: text/plain; name=\"$file_name\" \n";  
	$message .= "Content-Transfer-Encoding: base64 \n";  
	$message .= "Content-Disposition: attachment; filename=\"$file_name\" \n";  
	$message .= "\n";  
	$message .= $data."\n";  
	$message .= "\n";  
	$message .= "--".$boundary."--";  

	echo mail($mail_to, $subject, $message, $entete);

?>