Mon formulaire de contact ne fonctionne plus

Résolu/Fermé
Ppouille Messages postés 271 Date d'inscription jeudi 26 mars 2009 Statut Membre Dernière intervention 15 février 2024 - 19 janv. 2012 à 10:13
Ppouille Messages postés 271 Date d'inscription jeudi 26 mars 2009 Statut Membre Dernière intervention 15 février 2024 - 19 janv. 2012 à 12:19
Bonjour,

J'ai il y a un certain temps créé un formulaire de contact sur mon site, formulaire qui lorsqu'il était rempli par l'internaute, me parvenait sur mon adresse mail. Tout fonctionnait bien mais sans que je ne sache pourquoi, je viens de constater que cela ne fonctionne plus, pouvez-vous m'aider ?
Voici le code pour le formulaire de contact :
<html>
<head>
<meta http-equiv="Content-Language" content="fr-be">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Tennis Club Baudet Bertrix</title>
<script language="JavaScript">
<!--
function FP_swapImg() {//v1.0
var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_preloadImgs() {//v1.0
var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_getObjectByID(id,o) {//v1.0
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
return null;
}
// -->
</script>
</head>
<body bgcolor="#000066" onload="FP_preloadImgs(/*url*/'RetourSiteFormulaire2.gif', /*url*/'RetourSiteFormulaire3.gif')" background="../Images/Fond_Ecran_Menus.jpg">
<form method="POST" name="Formulaire de contact" action="verification.php" style="border: 1px solid #FFFFFF; background-color: #CC0000; background-image:url('../Images/Fond_Ecran_Principal.jpg')">
<p style="margin-top: 0; margin-bottom: 0" align="left"><b>
<font face="Verdana" color="#FFFFFF">      <u>FORMULAIRE DE CONTACT</u></font></b></p>
<p style="margin-top: 0; margin-bottom: 0" align="center"> </p>
<div style="position: absolute; width: 100px; height: 100px; z-index: 1; left: 393px; top: 96px" id="couche1">
<img border="0" src="../Images/Diapo_Partenaires.gif" width="200" height="115"></div>
<p style="margin-top: 0; margin-bottom: 0">
<font face="Verdana" size="2" color="#FFFFFF"><b>       
Quel service du Tennis Club Baudet Bertrix souhaitez-vous contacter :                                        </b></font></p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana">
<font color="#FFFFFF">
       
<input type="radio" value="V1" name="R1" style="font-weight: 700" checked></font><b><font size="2" color="#FFFFFF">La
Direction                                            </font></b></font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana">
<font color="#FFFFFF">
       
<input type="radio" value="V2" name="R1" style="font-weight: 700"></font><b><font size="2" color="#FFFFFF">Le
Secrétariat</font></b></font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana">
<font color="#FFFFFF">
       
<input type="radio" value="V3" name="R1" style="font-weight: 700"></font><b><font size="2" color="#FFFFFF">La
Comptabilité                                    </font></b></font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana">
<font color="#FFFFFF">
       
<input type="radio" value="V4" name="R1" style="font-weight: 700"></font><b><font size="2" color="#FFFFFF">L'Ecole
de tennis</font></b></font></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana">
<font color="#FFFFFF">
       
<input type="radio" value="V5" name="R1" style="font-weight: 700"></font><b><font size="2" color="#FFFFFF">Les
webmasters</font></b></font></p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"><b>
<font face="Verdana" size="2" color="#FFFFFF">             
<u>Données vous concernant</u> :</font></b></p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<table border="1" width="100%" id="table26" style="border-width: 0px">
<tr>
<td style="border-style: none; border-width: medium" width="1%" align="left" rowspan="7" valign="top">
<p style="margin-top: 0; margin-bottom: 0"> </td>
<td style="border-style: none; border-width: medium" width="14%" align="right">
<b><font face="Verdana" size="2" color="#FFFFFF">Nom :</font></b></td>
<td style="border-style: none; border-width: medium" colspan="3">
<font face="Verdana" size="2" color="#FFFFFF">
<input name="T1" size="35" style="font-weight: 700"></font></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="14%" align="right">
<b><font face="Verdana" size="2" color="#FFFFFF">Prénom :</font></b></td>
<td style="border-style: none; border-width: medium" colspan="3">
<font face="Verdana" size="2" color="#FFFFFF">
<input name="T4" size="35" style="font-weight: 700"></font></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="14%" align="right">
<b><font face="Verdana" size="2" color="#FFFFFF">Adresse :</font></b></td>
<td style="border-style: none; border-width: medium" colspan="3">
<font face="Verdana" size="2" color="#FFFFFF">
<input name="T5" size="50" style="font-weight: 700"></font></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="14%" align="right">
<b><font face="Verdana" size="2" color="#FFFFFF">Code Postal :</font></b></td>
<td style="border-style: none; border-width: medium" width="4%">
<font face="Verdana" size="2" color="#FFFFFF">
<input name="T6" size="5" style="font-weight: 700"></font></td>
<td style="border-style: none; border-width: medium" width="4%">
<p align="center"><b>
<font face="Verdana" size="2" color="#FFFFFF">Ville :</font></b></td>
<td style="border-style: none; border-width: medium" width="77%">
<font face="Verdana" size="2" color="#FFFFFF">
<input name="T7" size="32" style="font-weight: 700"></font></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="14%" align="right">
<b><font face="Verdana" size="2" color="#FFFFFF">Téléphone :</font></b></td>
<td style="border-style: none; border-width: medium" colspan="3">
<font face="Verdana" size="2" color="#FFFFFF">
<input name="T8" size="23" style="font-weight: 700"></font></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="14%" align="right">
<b><font face="Verdana" size="2" color="#FFFFFF">GSM :</font></b></td>
<td style="border-style: none; border-width: medium" colspan="3">
<font face="Verdana" size="2" color="#FFFFFF">
<input name="T9" size="23" style="font-weight: 700"></font></td>
</tr>
<tr>
<td style="border-style: none; border-width: medium" width="14%" align="right">
<b><font face="Verdana" size="2" color="#FFFFFF">Adresse de
messagerie :</font></b></td>
<td style="border-style: none; border-width: medium" colspan="3">
<input name="T10" size="45" style="font-weight: 700"></td>
</tr>
</table>
<p style="margin-top: 0; margin-bottom: 0"><i>
<font face="Verdana" size="1" color="#FFFFFF">                                                    
Obligatoire si vous souhaitez une réponse</font></i></p>
<p style="margin-top: 0; margin-bottom: 0"><b>
<font face="Verdana" size="2" color="#FFFFFF">        Votre message :</font></b></p>
<p style="margin-top: 0; margin-bottom: 0">
       
<textarea rows="8" name="S1" cols="84"></textarea></p>
<p style="margin-top: 0; margin-bottom: 0">
 </p>
<p style="margin-top: 0; margin-bottom: 0">        <input type="submit" value="Envoyer" name="B1"><input type="reset" value="Rétablir" name="B2"> 
<a href="../index.html">
<img border="0" id="img2" src="RetourSiteFormulaire1.gif" height="20" width="350" alt="> RETOUR AU SITE DU T.C.B.B." fp-style="fp-btn: Simple Text 1; fp-font: Verdana; fp-font-style: Bold; fp-font-size: 14; fp-font-color-normal: #FFFF00; fp-font-color-hover: #0000FF; fp-font-color-press: #0000FF; fp-justify-horiz: 0; fp-transparent: 1; fp-proportional: 0" fp-title="> RETOUR AU SITE DU T.C.B.B." onmouseover="FP_swapImg(1,0,/*id*/'img2',/*url*/'RetourSiteFormulaire2.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img2',/*url*/'RetourSiteFormulaire1.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img2',/*url*/'RetourSiteFormulaire3.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img2',/*url*/'RetourSiteFormulaire2.gif')"></a></p>
</form>
</body>
Et voici le code du formulaire réponse :


<head>
<meta http-equiv="Content-Language" content="fr-be">
<title>Tennis Club Baudet Bertrix</title>
<script language="JavaScript">
<!--
function FP_swapImg() {//v1.0
var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_preloadImgs() {//v1.0
var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_getObjectByID(id,o) {//v1.0
var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
return null;
}
// -->
</script>
</head>

<?php

//On récupère les données

$service = $_POST["R1"]; //On récupère le service que le client souhaite contacter
$nom = $_POST["T1"]; //On récupère le nom ...
$prenom = $_POST["T4"];
$adresse = $_POST["T5"];
$cpostal = $_POST["T6"];
$ville = $_POST["T7"];
$tel = $_POST["T8"];
$gsm = $_POST["T9"];
$mail = $_POST["T10"];
$contenu = $_POST["S1"]; //Le message du client

//En ce qui concerne $_POST['R1'], on aura 5 réponses possibles: V1, V2, V3, V4 ou V5
//On va donc creer des conditions afin que le service que l'internaute souhaite contacter soit écrit en toutes lettres (plus pratiue :D )

if( $service == V1){ $service2 = "Un internaute a contacté la Direction du T.C.B.B."; }
elseif( $service == V2){ $service2 = "Un internaute a contacté le Secrétariat du T.C.B.B."; }
elseif( $service == V3){ $service2 = "Un internaute a contacté la Comptabilité du T.C.B.B."; }
elseif( $service == V4){ $service2 = "Un internaute a contacté l'Ecole de tennis du T.C.B.B."; }
elseif( $service == V5){ $service2 = "Un internaute a contacté les Webmasters du T.C.B.B."; }
else{ $service2 = "L'internaute n'a pas spécifié le service qu'il souhaite contacter"; }
//Maintenant on met en forme le mail qui vous sera envoyé



$headers = 'From: "Nom" <'.$mail.'>'."\n";
$headers .='Reply-To: patrick.vanpoeyer@gmail.com'."\n"; // Ici l'adresse de réponse
$headers .='Content-Type: text/html; charset="iso-8859-1"'."\n";
$headers .='Content-Transfer-Encoding: 8bit';

//Maintenant on rempli le mail avec la variable $message :)

$message ='<html>';
$message .='<head></head><body>';
$message .="<p>Informations concernant l'expéditeur<br />";
$message .="Adresse mail de l'expediteur: <b>".$mail."</b><br />";
$message .="Nom: <b>".$nom."</b><br />";
$message .="Prenom: <b>".$prenom."</b><br />";
$message .="Adresse: <b>".$adresse."</b><br />"; // Le résultat sera par exemple: 20 rue du Lapin 33000 Bordeaux ;D
$message .="Ville: <b>".$cpostal." ".$ville."</b><br />"; // Le résultat sera par exemple: 20 rue du Lapin 33000 Bordeaux ;D
$message .="Téléphone: <b>".$tel."</b><br />";
$message .="GSM: <b>".$gsm."</b><br /><br /><br />";
$message .="<center>---------------------------------------</center><br />";
$message .= $contenu."</p>"; // Ici le message du client
$message .= "</body></html>";

//On envoi le message. N'oubliez pas de changer votreadresse@jenesaispas.fr ;)

if(mail('patrick.vanpoeyer@gmail.com', $service2, $message, $headers)) //J'ai remplacer 'Sujet' par $service2. Ainsi, vous serez immédiatement quel service le client souhaite contacter

{
echo 'Nous accusons bonne réception de votre message.';
}
else
{
echo 'Erreur! Le message n\'a pu être envoyé';
}
?><body bgcolor="#CC0000" text="#FFFFFF" onload="FP_preloadImgs(/*url*/'RetourSiteFormulaire3.gif',/*url*/'RetourSiteFormulaire2.gif')" background="../Images/Fond_Ecran_Principal.jpg"><p style="margin-top: 0; margin-bottom: 0" align="left">
<b><font face="Verdana" size="2">       
</font></b></p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Times New Roman">Nous
mettons tout en oeuvre afin qu'une suite y soit donnée dans les plus brefs
délais.</font></p>
<p style="margin-top: 0; margin-bottom: 0"> </p>

<p style="margin-top: 0; margin-bottom: 0">
<font face="Verdana" size="2">
<img border="0" src="../Images/Bandeau_Verification.jpg" width="1000" height="166">
</font> </p>

<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana" size="2">       
</font></p>
<p style="margin-top: 0; margin-bottom: 0"><b><font size="2" face="Verdana"></a>
<img border="0" src="../Images/Logo_Chine_Imperiale.gif" width="200" height="115">   
<img border="0" src="../Images/Logo_Gigatour.gif" width="200" height="115">   
<img border="0" src="../Images/Logo_Bertrix_Decor.gif" width="200" height="115"></font></b></p>

<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0">  </p>
<p style="margin-top: 0; margin-bottom: 0"><b><font face="Verdana" size="4">Merci
de nous avoir contacté</font></b></p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"> </p>


<p style="margin-top: 0; margin-bottom: 0"><a href="../index.html">
<img border="0" id="img2" src="RetourSiteFormulaire1.gif" height="20" width="350" alt="> RETOUR AU SITE DU T.C.B.B." onmouseover="FP_swapImg(1,0,/*id*/'img2',/*url*/'RetourSiteFormulaire2.gif')" onmouseout="FP_swapImg(0,0,/*id*/'img2',/*url*/'RetourSiteFormulaire1.gif')" onmousedown="FP_swapImg(1,0,/*id*/'img2',/*url*/'RetourSiteFormulaire3.gif')" onmouseup="FP_swapImg(0,0,/*id*/'img2',/*url*/'RetourSiteFormulaire2.gif')" fp-style="fp-btn: Simple Text 1; fp-font: Verdana; fp-font-style: Bold; fp-font-size: 14; fp-font-color-normal: #FFFF00; fp-font-color-hover: #0000FF; fp-font-color-press: #0000FF; fp-justify-horiz: 0; fp-transparent: 1; fp-proportional: 0; fp-orig: 0" fp-title="> RETOUR AU SITE DU T.C.B.B."></a></p>

Mon adresse mail est bien : patrick.vanpoeyer@gmail.com

Pouvez-vous m'aider svp,
D'avance merci

5 réponses

Melooo Messages postés 1405 Date d'inscription vendredi 28 novembre 2008 Statut Membre Dernière intervention 18 mars 2013 84
19 janv. 2012 à 10:22
Bonjour,
1) Mettre son code entre les balises <> codes.
2) Ne fonctionne plus ?? mais encore ? tu as un message d'erreur ? rien du tout ?
3) As-tu vérifier que ton mail n'arrive pas dans le courrier indésirable ?
0
Ppouille Messages postés 271 Date d'inscription jeudi 26 mars 2009 Statut Membre Dernière intervention 15 février 2024 3
19 janv. 2012 à 10:29
Merci pour ta réponse rapide.
Lorsqu'on rempli le formulaire et qu'on clique sur envoyer, l'internaute reçoit bien le message comme quoi son message est bien délivré et qu'il sera traité sous les meilleurs délais. Mais moi je ne reçois rien sur ma boite mail ?
Non, pas dans courriers indésirables !
Merci pour ton aide
0
Melooo Messages postés 1405 Date d'inscription vendredi 28 novembre 2008 Statut Membre Dernière intervention 18 mars 2013 84
19 janv. 2012 à 11:05
Essayes de mettre :
$headers = 'Mime-Version: 1.0'."\r\n";
0
Ppouille Messages postés 271 Date d'inscription jeudi 26 mars 2009 Statut Membre Dernière intervention 15 février 2024 3
19 janv. 2012 à 11:10
A quel endroit ?
0
Melooo Messages postés 1405 Date d'inscription vendredi 28 novembre 2008 Statut Membre Dernière intervention 18 mars 2013 84
19 janv. 2012 à 11:17
Euh la :
$headers = 'From: "Nom" <'.$mail.'>'."\n";
$headers .='Reply-To: patrick.vanpoeyer@gmail.com'."\n"; // Ici l'adresse de réponse
$headers .='Content-Type: text/html; charset="iso-8859-1"'."\n";
$headers .='Content-Transfer-Encoding: 8bit'; 
$headers .= 'Mime-Version: 1.0'."\r\n";

0
Ppouille Messages postés 271 Date d'inscription jeudi 26 mars 2009 Statut Membre Dernière intervention 15 février 2024 3
19 janv. 2012 à 11:42
Non, rien ne change, snif
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Ppouille Messages postés 271 Date d'inscription jeudi 26 mars 2009 Statut Membre Dernière intervention 15 février 2024 3
19 janv. 2012 à 12:19
J'ai trouvé ! J'ai remplacé mon adresse mail par une adresse de mon hébergeur qui elle est redirigée vers mon adresse mail, et la, bingo, ça fonctionne.
Bizarre mais ça marche, c'est l'essentiel.
En tous cas merci pour ton aide.
Au plaisir.
0