<?php 
	require("config.inc.php");
	if(isset($_POST['email']) && isset($_POST['nom']) && isset($_POST['commentaires'])) {
		$headers = "From: ".$_POST['nom']."<".$_POST['email'].">\r\n"; 
		$headers .= "X-Sender: ".$_POST['email']."\r\n"; 
		$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
		$headers .= "X-Priority: 2\r\n";
		$headers .= "Return-Path: ".$_POST['email']."\r\n";
		$headers .= "MIME-Version: 1.0\r\n"; 
		$headers .= "Content-Type: text/plain; charset=\"US-ASCII\"\r\n";
		$headers .= "Content-Transfer-Encoding: 7bit\r\n"; 

		if(mail($to, $titre, $_POST['commentaires'], $headers)) {
			header("Location:../".$lienOK);
		} else {
			header("Location:../".$lienPasOK);
		}
	} else {
		header("Location:../".$lienPasOK);
	}
?>