Script d'envoi formulaire par mail
Bonjour,
Je voudrais envoyer un formulaire par mail le code suivant ne provoque aucune erreur mais je ne reçois rien ( sauf
Pouvez vous m 'aider a comprendre d'ou viens ce problème
le form
Code:
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
| <!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></title>
</head>
<body>
<div align="center">
<form method="post" action="/formmail.php">
<input name="subject" value="formmail" type="hidden">
<table>
<tbody>
<tr>
<td>Votre Pseudo:</td>
<td><input name="realname" size="30" type="text"></td>
</tr>
<tr>
<td>Votre Site/blog*:</td>
<td><input name="site" size="30" type="text"></td>
</tr>
<tr>
<td>Veut tu recevoir les news du site:</td>
<td><input name="news" size="30" type="text"></td>
</tr>
<tr>
<td>Veut tu recevoir des offres partenaire²:</td>
<td><input name="site" size="30" type="text"></td>
</tr>
<tr>
<td>Votre Email:</td>
<td><input name="email" size="30" type="text"></td>
</tr>
<tr>
<td>Sujet ( Contact/histoire/dessins/.....):</td>
<td><input name="title" size="30" type="text"></td>
</tr>
<tr>
<td colspan="2">Votre message:<br>
<textarea cols="50" rows="6" name="comments"></textarea>
</td>
</tr>
</tbody>
</table>
<br>
<input value="Envoyer" type="submit"> -
<input value="Annuler" type="reset">
</form>
</div>
</body>
</html> |
Le php
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <?php
$TO = "contact@xx.fr";
$h = "From: " . $TO;
$message = "";
while (list($key, $val) = each($HTTP_POST_VARS)) {
$message .= "$key : $val\n";
}
mail($TO, $subject, $message, $h);
Header("Location: http://www.xxxx.fr");
?> |