j'ai mon fichier php qui traite mon formulaire qui est un peu buggé. Je reçois 2 emails...
Vous savez pourquoi?
De plus je voudrais que le "From" dans le mail que je reçois soit la valeur de "Email" dans le formulaire rempli par l'internaute. Histoire de pouvoir faire répondre.
<?php
$TO = "[email protected]";
// Header of the e-mail
$Splitter = "-----=".md5(uniqid(rand()));
$h = "MIME-Version: 1.0\r\n";
$h .= "Content-Type: multipart/mixed; boundary=\"$Splitter\"\r\n";
$h .= "From: $From\r\n";
$h .= "\r\n";
while (list($key, $val) = each($HTTP_POST_VARS)) {
$message .= "$key : $val\n";
}
// Message texte
$msg .= "--$Splitter\r\n";
$msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
$msg .= "Content-Transfer-Encoding:8bit\r\n";
$msg .= "\r\n";
$msg .= $message;
$msg .= "\r\n";
// End header
$msg .= "--$Splitter--\r\n";
$Subject .= "Nouveau message depuis le site Internet";
$Reply .= $Email;
return mail($TO, mb_encode_mimeheader($Subject), $msg, "Reply-to: $Reply\r\n".$h);
Header("Location: confirmation.html");
?>
Merci d'avance pour votre aide