pb formulaire par mail
Posté : 27 juin 2012, 14:10
Bonjour,
j'ai créé un formulaire html et un script php pour envoyer sur une boite mail mais j'ai le message suivant :
\n"; $entete .= "MIME-Version: 1.0"; if (@mail([email protected],$_POST["nom_societe"],$_POST["message"],$entete)){ // mail envoyé echo "Votre message a été envoyé"; } else { // erreur lors de l'envoi du mail echo "Un problème s'est produit lors de l'envoi du message"; } ?>
Le script est le suivant :
<?php
$message = ""; // initialisation du message
$message .= " Nom société: {$_POST['nom_societe']}";
$message .= " Nom: {$_POST['nom_responsable']}";
$message .= " Prénom: {$_POST['email']}";
$message .= " Téléphone: {$_POST['email']}";
// le formulaire a été soumis sans erreur, on envoie le mail
$entete = "From: ".$_POST["email"]." <".$_POST["email"].">\n";
$entete .= "MIME-Version: 1.0";
if (@mail([email protected],$_POST["nom_societe"],$_POST["message"],$entete)){
// mail envoyé
echo "Votre message a été envoyé";
}
else {
// erreur lors de l'envoi du mail
echo "Un problème s'est produit lors de l'envoi du message";
}
?>
Le formulaire :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>RAMASSAGE COLIS EXPRESS - TNCIS</title>
</head>
<body>
<small style="font-family: Arial;"><br>
<br>
</small>
<table
style="text-align: left; width: 1129px; height: 234px; font-family: Arial;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr style="font-weight: bold;" align="center">
<td><big><img style="width: 171px; height: 113px;"
alt="TNCIS" src="tncis.jpg" align="middle"><big
style="color: rgb(34, 153, 197);">DEMANDE DE RAMASSAGE</big></big></td>
</tr>
<tr style="font-weight: bold;">
<td></td>
</tr>
<tr>
<td>
<form method="post" action="envoi2.php"
name="ramassage"><small><br>
</small>
<table
style="text-align: left; width: 1114px; height: 1382px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="background-color: rgb(192, 192, 192);"><small><span
style="font-weight: bold;"><br>
</span></small>
<div style="margin-left: 40px;"><small><span
style="font-weight: bold;">Etape 1/7 : au moment du
ramassage, votre colis sera-t-il étiqueté aux
normes TNCIS Express National ?</span></small><br>
<small><span style="font-weight: bold;"></span></small></div>
<small><span style="font-weight: bold;"></span></small></td>
</tr>
<tr>
<td><small><input name="Etiquete"
type="checkbox"> Oui, il sera
étiqueté <br>
<input name="Etiquete Non" type="checkbox">Non,
il ne sera pas étiqueté <br>
Vous
pouvez vous rendre dans l'espace d'édition des bons de
transport pour
réaliser une fois votre demande de ramassage et son
étiquette. Si vous
complété votre demande, votre colis sera
étiqueté par TNCIS</small></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small
style="font-weight: bold;"><br>
Etape 2/7 : renseignements généraux <br>
</small></div>
</td>
</tr>
<tr>
<td><small><br>
Compte de ramassage
<select name="comptes">
<option value="02 96 92 91 90">GODEFROY -
SIEGE</option>
<option value="05 53 46 70 01">GODEFROY -
PERIGUEUX</option>
<option value="03 80 28 56 01">GODEFROY -
DIJON</option>
<option value="04 75 81 02 45">GODEFROY -
MONTELIMAR</option>
</select>
</small></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small><span
style="font-weight: bold;"><br>
Etape 3/7 : Notification pour ce ramassage <br>
</span> </small></div>
</td>
</tr>
<tr>
<td><small><br>
Une information en cas d'anomalie vous sera automatiquement
envoyée par e-mail<br>
</small>
<div style="margin-left: 40px;"><small>E-mail
: </small><small><input size="30" name="email"></small><br>
</div>
<small><br>
</small>
<div style="margin-left: 40px;"><small><input
name="information ramassage" type="checkbox"> Je
souhaite également être informé que ce
ramassage a bien été
effectué
</small><br>
</div>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small
style="font-weight: bold;"><br>
Etape 4/7 Adresse de ramassage<br>
</small></div>
</td>
</tr>
<tr>
<td><br>
<table style="text-align: left; width: 100%;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 300px;"><small>Société
/ Nom</small></td>
<td style="width: 783px;"><input
size="70" name="nom_societe"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Adresse</small></td>
<td style="width: 783px;"><input
size="70" name="adresse1_societe"></td>
</tr>
<tr>
<td style="width: 300px;"></td>
<td style="width: 783px;"><input
size="70" name="adresse2_societe"></td>
</tr>
<tr>
<td style="width: 300px;"><small>CP/Commune</small></td>
<td style="width: 783px;"><input
size="20" name="cp_societe"> <input size="40"
name="ville_societe"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Service</small></td>
<td style="width: 783px;"><input
size="40" name="service_societe"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Nom
</small></td>
<td style="width: 783px;"><input
size="40" name="nom_responsable"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Prénom</small></td>
<td style="width: 783px;"><input
size="40" name="prenom_responsable"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Téléphone</small></td>
<td style="width: 783px;"><input
name="telephone_responsable"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Instructions
particulières</small></td>
<td style="width: 783px;"><input
size="90" name="instructions"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);"><br>
<div style="margin-left: 40px;"><small
style="font-weight: bold;">Etape 5/7 Date de ramassage</small><br>
</div>
</td>
</tr>
<tr>
<td>
<table style="text-align: left; width: 100%;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 299px;"><small>Date
demandée (jj/mm/aaaa)</small></td>
<td style="width: 784px;"><input
name="date_ramassage"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small
style="font-weight: bold;"><br>
Etape 6/7 : Destinataire<br>
</small></div>
</td>
</tr>
<tr>
<td>
<table
style="text-align: left; width: 1103px; height: 139px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 299px;"><small>Société/
Nom</small></td>
<td style="width: 784px;"><input
name="nom_destinataire"><br>
</td>
</tr>
<tr>
<td style="width: 299px;"><small>Adresse</small></td>
<td style="width: 784px;"><input
name="adresse1_destinataire"></td>
</tr>
<tr>
<td style="width: 299px;"></td>
<td style="width: 784px;"><input
name="adresse2_destinataire"></td>
</tr>
<tr>
<td style="width: 299px;"><small>CP/Commune</small></td>
<td style="width: 784px;"><input
name="cp_destinataire"> <input name="ville_destinataire"></td>
</tr>
<tr>
<td style="width: 299px;"><small>Téléphone</small></td>
<td style="width: 784px;"><input
name="telephone_destinataire"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small
style="font-weight: bold;"><br>
Etape 7/7 : Service de livraison<br>
</small></div>
</td>
</tr>
<tr>
<td>
<table
style="text-align: left; width: 1103px; height: 139px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 299px;"><small>Nombre
de colis</small></td>
<td style="width: 784px;"><input
name="nombre_colis"><br>
</td>
</tr>
<tr>
<td style="width: 299px;"><small>Poids
colis</small></td>
<td style="width: 784px;"><input
name="poids_colis"></td>
</tr>
<tr>
<td style="width: 299px;"><small>Vos
références</small></td>
<td style="width: 784px;"><input
name="reference"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table
style="text-align: left; width: 1103px; height: 63px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 299px;"><small><br>
</small></td>
<td style="width: 784px;"><input
value="ok" name="envoi" type="submit"><br>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<small><br>
<br>
</small></form>
</td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
j'ai créé un formulaire html et un script php pour envoyer sur une boite mail mais j'ai le message suivant :
\n"; $entete .= "MIME-Version: 1.0"; if (@mail([email protected],$_POST["nom_societe"],$_POST["message"],$entete)){ // mail envoyé echo "Votre message a été envoyé"; } else { // erreur lors de l'envoi du mail echo "Un problème s'est produit lors de l'envoi du message"; } ?>
Le script est le suivant :
<?php
$message = ""; // initialisation du message
$message .= " Nom société: {$_POST['nom_societe']}";
$message .= " Nom: {$_POST['nom_responsable']}";
$message .= " Prénom: {$_POST['email']}";
$message .= " Téléphone: {$_POST['email']}";
// le formulaire a été soumis sans erreur, on envoie le mail
$entete = "From: ".$_POST["email"]." <".$_POST["email"].">\n";
$entete .= "MIME-Version: 1.0";
if (@mail([email protected],$_POST["nom_societe"],$_POST["message"],$entete)){
// mail envoyé
echo "Votre message a été envoyé";
}
else {
// erreur lors de l'envoi du mail
echo "Un problème s'est produit lors de l'envoi du message";
}
?>
Le formulaire :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>RAMASSAGE COLIS EXPRESS - TNCIS</title>
</head>
<body>
<small style="font-family: Arial;"><br>
<br>
</small>
<table
style="text-align: left; width: 1129px; height: 234px; font-family: Arial;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr style="font-weight: bold;" align="center">
<td><big><img style="width: 171px; height: 113px;"
alt="TNCIS" src="tncis.jpg" align="middle"><big
style="color: rgb(34, 153, 197);">DEMANDE DE RAMASSAGE</big></big></td>
</tr>
<tr style="font-weight: bold;">
<td></td>
</tr>
<tr>
<td>
<form method="post" action="envoi2.php"
name="ramassage"><small><br>
</small>
<table
style="text-align: left; width: 1114px; height: 1382px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="background-color: rgb(192, 192, 192);"><small><span
style="font-weight: bold;"><br>
</span></small>
<div style="margin-left: 40px;"><small><span
style="font-weight: bold;">Etape 1/7 : au moment du
ramassage, votre colis sera-t-il étiqueté aux
normes TNCIS Express National ?</span></small><br>
<small><span style="font-weight: bold;"></span></small></div>
<small><span style="font-weight: bold;"></span></small></td>
</tr>
<tr>
<td><small><input name="Etiquete"
type="checkbox"> Oui, il sera
étiqueté <br>
<input name="Etiquete Non" type="checkbox">Non,
il ne sera pas étiqueté <br>
Vous
pouvez vous rendre dans l'espace d'édition des bons de
transport pour
réaliser une fois votre demande de ramassage et son
étiquette. Si vous
complété votre demande, votre colis sera
étiqueté par TNCIS</small></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small
style="font-weight: bold;"><br>
Etape 2/7 : renseignements généraux <br>
</small></div>
</td>
</tr>
<tr>
<td><small><br>
Compte de ramassage
<select name="comptes">
<option value="02 96 92 91 90">GODEFROY -
SIEGE</option>
<option value="05 53 46 70 01">GODEFROY -
PERIGUEUX</option>
<option value="03 80 28 56 01">GODEFROY -
DIJON</option>
<option value="04 75 81 02 45">GODEFROY -
MONTELIMAR</option>
</select>
</small></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small><span
style="font-weight: bold;"><br>
Etape 3/7 : Notification pour ce ramassage <br>
</span> </small></div>
</td>
</tr>
<tr>
<td><small><br>
Une information en cas d'anomalie vous sera automatiquement
envoyée par e-mail<br>
</small>
<div style="margin-left: 40px;"><small>E-mail
: </small><small><input size="30" name="email"></small><br>
</div>
<small><br>
</small>
<div style="margin-left: 40px;"><small><input
name="information ramassage" type="checkbox"> Je
souhaite également être informé que ce
ramassage a bien été
effectué
</small><br>
</div>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small
style="font-weight: bold;"><br>
Etape 4/7 Adresse de ramassage<br>
</small></div>
</td>
</tr>
<tr>
<td><br>
<table style="text-align: left; width: 100%;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 300px;"><small>Société
/ Nom</small></td>
<td style="width: 783px;"><input
size="70" name="nom_societe"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Adresse</small></td>
<td style="width: 783px;"><input
size="70" name="adresse1_societe"></td>
</tr>
<tr>
<td style="width: 300px;"></td>
<td style="width: 783px;"><input
size="70" name="adresse2_societe"></td>
</tr>
<tr>
<td style="width: 300px;"><small>CP/Commune</small></td>
<td style="width: 783px;"><input
size="20" name="cp_societe"> <input size="40"
name="ville_societe"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Service</small></td>
<td style="width: 783px;"><input
size="40" name="service_societe"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Nom
</small></td>
<td style="width: 783px;"><input
size="40" name="nom_responsable"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Prénom</small></td>
<td style="width: 783px;"><input
size="40" name="prenom_responsable"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Téléphone</small></td>
<td style="width: 783px;"><input
name="telephone_responsable"></td>
</tr>
<tr>
<td style="width: 300px;"><small>Instructions
particulières</small></td>
<td style="width: 783px;"><input
size="90" name="instructions"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);"><br>
<div style="margin-left: 40px;"><small
style="font-weight: bold;">Etape 5/7 Date de ramassage</small><br>
</div>
</td>
</tr>
<tr>
<td>
<table style="text-align: left; width: 100%;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 299px;"><small>Date
demandée (jj/mm/aaaa)</small></td>
<td style="width: 784px;"><input
name="date_ramassage"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small
style="font-weight: bold;"><br>
Etape 6/7 : Destinataire<br>
</small></div>
</td>
</tr>
<tr>
<td>
<table
style="text-align: left; width: 1103px; height: 139px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 299px;"><small>Société/
Nom</small></td>
<td style="width: 784px;"><input
name="nom_destinataire"><br>
</td>
</tr>
<tr>
<td style="width: 299px;"><small>Adresse</small></td>
<td style="width: 784px;"><input
name="adresse1_destinataire"></td>
</tr>
<tr>
<td style="width: 299px;"></td>
<td style="width: 784px;"><input
name="adresse2_destinataire"></td>
</tr>
<tr>
<td style="width: 299px;"><small>CP/Commune</small></td>
<td style="width: 784px;"><input
name="cp_destinataire"> <input name="ville_destinataire"></td>
</tr>
<tr>
<td style="width: 299px;"><small>Téléphone</small></td>
<td style="width: 784px;"><input
name="telephone_destinataire"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td style="background-color: rgb(192, 192, 192);">
<div style="margin-left: 40px;"><small
style="font-weight: bold;"><br>
Etape 7/7 : Service de livraison<br>
</small></div>
</td>
</tr>
<tr>
<td>
<table
style="text-align: left; width: 1103px; height: 139px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 299px;"><small>Nombre
de colis</small></td>
<td style="width: 784px;"><input
name="nombre_colis"><br>
</td>
</tr>
<tr>
<td style="width: 299px;"><small>Poids
colis</small></td>
<td style="width: 784px;"><input
name="poids_colis"></td>
</tr>
<tr>
<td style="width: 299px;"><small>Vos
références</small></td>
<td style="width: 784px;"><input
name="reference"></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table
style="text-align: left; width: 1103px; height: 63px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 299px;"><small><br>
</small></td>
<td style="width: 784px;"><input
value="ok" name="envoi" type="submit"><br>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<small><br>
<br>
</small></form>
</td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>