par
CoacHu » 10 janv. 2006, 16:58
Voici le code que j'utilise dans le fichier php du formulaire
Code : Tout sélectionner
<?php
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: CIRCM <[email protected]>' . "\r\n";
$headers .= 'From: Youan L. Gagnon <[email protected]>' . "\r\n";
$headers .= 'Cc:' . "\r\n";
$headers .= 'Bcc:' . "\r\n";
// subject
$subject = 'Questionnaire - Intervenants en milieu secondaire';
$message = '
<html>
<head>
<style type="text/css">
question {
color:#999;
cursor:pointer;
padding-left:2px;
line-height:15px;
vertical-align:top;
}
reponse {
color:#000;
cursor:pointer;
padding-left:2px;
line-height:15px;
vertical-align:top;
}
</style>
<title>Questionnaire - Intervenants en milieu secondaire</title>
</head>
<body>
<question>Nom de lecole:</question> <reponse>'.$nomecole.'</reponse><br>
<question>Ville:</question> <reponse>'.$ville.'</reponse><br>
<question>Region</question> <reponse>'.$region.'</reponse><br><br>
<question>Cycle denseignement:</question> <reponse>'.$cycledenseignement.'</reponse><br>
<question>Nombre approximatif deleves: </question> <reponse>'.$nombredeleves.'</reponse><br><br>
<table>
<tr>
<th>Col1</th><th>Col2</th><th>Col3</th><th>Col4</th>
</tr>
<tr>
<td>'. $region . '</td><td>'.$Variable2.'</td><td>'.$Variable3.'</td><td>'.$Variable4.'</td>
</tr>
</table>
</body>
</html>
';
if(mail($to, $subject, $message, $headers))
{
header('Location: http://www.grabugegraphique.org/merci.html'); }
else
{
echo 'Email Failed - Technical Fault';
}
?>
Et le résultat, pour ce qui est de École par exemple, donne ceci: École
Je vais tenté de trouver avec les charset... mais si quelqu'un a une idée
Merci !!!
Voici le code que j'utilise dans le fichier php du formulaire
[code]
<?php
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: CIRCM <
[email protected]>' . "\r\n";
$headers .= 'From: Youan L. Gagnon <
[email protected]>' . "\r\n";
$headers .= 'Cc:' . "\r\n";
$headers .= 'Bcc:' . "\r\n";
// subject
$subject = 'Questionnaire - Intervenants en milieu secondaire';
$message = '
<html>
<head>
<style type="text/css">
question {
color:#999;
cursor:pointer;
padding-left:2px;
line-height:15px;
vertical-align:top;
}
reponse {
color:#000;
cursor:pointer;
padding-left:2px;
line-height:15px;
vertical-align:top;
}
</style>
<title>Questionnaire - Intervenants en milieu secondaire</title>
</head>
<body>
<question>Nom de lecole:</question> <reponse>'.$nomecole.'</reponse><br>
<question>Ville:</question> <reponse>'.$ville.'</reponse><br>
<question>Region</question> <reponse>'.$region.'</reponse><br><br>
<question>Cycle denseignement:</question> <reponse>'.$cycledenseignement.'</reponse><br>
<question>Nombre approximatif deleves: </question> <reponse>'.$nombredeleves.'</reponse><br><br>
<table>
<tr>
<th>Col1</th><th>Col2</th><th>Col3</th><th>Col4</th>
</tr>
<tr>
<td>'. $region . '</td><td>'.$Variable2.'</td><td>'.$Variable3.'</td><td>'.$Variable4.'</td>
</tr>
</table>
</body>
</html>
';
if(mail($to, $subject, $message, $headers))
{
header('Location: http://www.grabugegraphique.org/merci.html'); }
else
{
echo 'Email Failed - Technical Fault';
}
?>
[/code]
Et le résultat, pour ce qui est de École par exemple, donne ceci: École
Je vais tenté de trouver avec les charset... mais si quelqu'un a une idée :)
Merci !!!