<?php
session_start();
// To
$to = 'al.lafont@gmail.com';
 
// Subject
$subject = 'Contact Espace Personnel : '.$_GET['contact-subject'].' ';
 
// Headers
$headers ='From: "Site Cnam"'."\n";
$headers .='Content-Type:text/html; charset="utf-8"'."\n"; 
$headers .='Content-Transfer-Encoding: 8bit';

// Message
$msg = '';

$msg .= "
	<b>Nom de l'entreprise : </b>".ucfirst(strtolower($_SESSION['entreprise']['nom']))."<br>
	<b>Adresse e-mail : </b>".$_GET['contact-mail']."<br><br>
	<b>Objet :</b><br>".$_GET["contact-subject"]."<br><br>
	<b>Demande :</b><br>".$_GET["contact-text"];

$msg .='<br><br><b>Autres infos : </b><br><i style="font-size:12px">';

foreach($_SESSION['entreprise'] as $key => $value){
	$msg .= '<b>'.$key.' : </b>'.$value.'<br>';
}

$msg .= '</i>';

mail($to, $subject, $msg, $headers);
?>
