<?php
echo '<?xml version="1.0" encoding="iso-utf-8"?>'."\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-ch" lang="fr-ch">
<head>
	<title>Notification d'envoi d'Émail doSimple</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<link type="text/css" rel="stylesheet" href="/css/nn.css" />

<style type="text/css">body{ text-align:center; }</style>

<body>

<h2>Notification d'envoi d'Émail doSimple</h2>

<?php
// envoyeur de mails
error_reporting(E_ALL);

if( preg_match("#[\r|\n]#",$_POST["mailClient"]) )
{
    die;
}

if( preg_match("#\nbcc:#i",$_POST["textClient"]) )
{
    die;
}

if( preg_match("#\nto:#i",$_POST["textClient"]) )
{
    die;
}

if(empty($_POST["mailClient"]) || empty($_POST["textClient"]))
{
    die;
}

if(mail("greut@altern.org, batiste@dosimple.ch","contact [doSimple]","\r\nMail du client : \r\n\r\n".$_POST["mailClient"]." : \r\n".$_POST["textClient"],"From: no-reply@dosimple.ch\r\n"))
{
    	echo "<p>Votre message a été envoyé. Merci de votre attention.</p>";
	/*header("HTTP/1.1 302 Temporary redirect");
	header("Location : http://".$_SERVER["SERVER_NAME"]);
	header("Connection: close");*/
	echo '<p><a href="'.$_SERVER["HTTP_REFERER"].'"> Retour à la page de contact doSimple.</a></p>';
}
else
{
	echo "<p><strong>échec :</strong></p>";
	echo '<p><a href="'.$_SERVER["HTTP_REFERER"].'">retour</a></p>';
}
?>

</body>
</html>
