1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <?php
require("config.inc.php");
if(isset($_POST['email']) && isset($_POST['nom']) && isset($_POST['sujet']) && isset($_POST['commentaires']) && isset($_POST['telephone'])) {
$headers = "From: ".htmlspecialchars($_POST['nom'])."<".$_POST['email'].">\r\n";
$headers .= "X-Sender: ".htmlspecialchars($_POST['email'])."\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$headers .= "X-Priority: 2\r\n";
$headers .= "Return-Path: ".htmlspecialchars($_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, htmlspecialchars($_POST['sujet']), htmlspecialchars($_POST['commentaires']), $headers)) {
header("Location:../".$lienOK);
} else {
header("Location:../".$lienPasOK);
}
} else {
header("Location:../".$lienPasOK);
}
?> |