Bonjour à tous,
une petite question à vous soumettre et qui me pose problème (débutant codeur).
je veux envoyer le résultat de champs de saisies vie un formulaire puis l'envoyer par mail au gestionnaire. j'ai un problème de formatage de texte à la réception de mon mail, je reçois en texte brut. normal ?
ceux qui ont le courage de tester (c'est vraiment pa terrible),
voici mon formulaire (y'a surement mieux mais je débute) :
et le code php qui traite l'envoi (traitement.php) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99 <html> <head><title>Formulaire</title> <meta http-equiv="Content-Type" content="html; charset=iso-8859-1"> </head> <body> <form name='formulaire' action='traitement.php' method='post'> <p align="center"><font color="#2A2AFF">Fiche</font></p> <p><b><i><u>Fiche créée le :</u></i></b> <br><br> <b><i><u><td>Auteur </td></u></i></b><br><br> <select name="Auteur"> <option></option> <option>Nom1</option> <option>Nom2</option> </select> </p> <p> <br/> <b><i><u>Nature de l'opération </u></i></b> </p> <table width="91%" border="0"> <tr> <td width="13%"><input name="Installation" type="checkbox"> Installation </td> <td width="12%"> <div align="left"> <select name="Installation"> <td><select name="Déplacement"> <option></option> <option>choix1</option> <option>choix2</option> <option>choix3</option> </select> </div></td> <td width="75%"> </td> </tr> <tr> <td><input name="Déplacement" type="checkbox"> Déplacement </td> <td><select name="Déplacement"> <option></option> <option>choix1</option> <option>choix2</option> <option>choix3</option> </select></td> <td> Vers : <select name="Vers"> <option></option> <option>choix1</option> <option>choix2</option> <option>choix3</option> </select></td> </tr> <tr> <td><input type="checkbox" name="Sortie Inventaire"/> Sortie Inventaire </td> <td> </td> <td> </td> </tr> <tr> <td><input type="checkbox" name="Destruction"/> test</td> <td> </td> <td> </td> </tr> </table> <p> <em><strong><u>Informations</u></strong></em></p> <table width="91%" height="56" border="0"> <tr align="left" valign="middle"> <td width="13%" height="26" valign="top">Nature du Matériel </td> <td width="87%" valign="middle"> <select name="Nature Matériel"> <option></option> <option>choix1</option> <option>choix2</option> </select> </td> </tr> <tr> <td height="24" valign="top">Numéro de série</td> <td valign="middle"> <input type="text" name="Numéro de Série"> </td> </tr> </table> <p><em><strong><u>Pour l'inventaire</u></strong></em></p> <table width="91%" height="27" border="0"> <tr valign="middle"> <td width="13%" height="23"> <div align="left">inventaire</div></td> <td width="87%"> <div align="left"> <input type="text" name="Date saisie Parc info"> </div></td> </tr> </table> <p><br /> <input type="submit" value="Envoyer"> <br> <br> <input type="reset" value="Corriger" name="reset"></p> </p> </form> </body> </html>
Je pensais que je les recevrait en html (pour info, ma messagerie est thunderbird (obligatoire) et j'envoi et reçois mes messages en html sans soucis).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 <?php ini_set('SMTP',xxxx.fr'); $TO = "xx@xx.fr"; $subject = "Fiche"; $h = "From: " . $TO; $message = ""; while (list($key, $val) = each($HTTP_POST_VARS)) { $message .= "$key : $val\n"; } mail($TO, $subject, $message, $h); ?>
quelqu'un pourrait éclairer ma lanterne ?
Merci d'avance et désolé si ce post fait doublon.
ah oui j'oubliais, mes caractères accentués sont impec' mais mes espaces sont remplacés par des "_" dans le nom des input type text.
Partager