Bonjour,
j'ai une page PHP qui envoie un mail :avec en début de fichier ceci :
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 $adresse="---"; $prenom=$_POST["prenom"]; $nom=$_POST["nom"]; $email=$_POST["email"]; $from="From: $prenom $nom<$email>\r\n"; $from.="Reply-To: $prenom $nom <$email>\n"; $from.="X-priority:3\n"; $msg=$_POST["texte"]; $nom=$_POST["nom"]; $prenom=$_POST["prenom"]; $msg = get_magic_quotes_gpc() ? stripslashes( $msg ) : $msg; $texte = $nom. ' '. $prenom.' : <br>'.'Ma question est :<br>'.$msg; $texte = utf8_encode($texte); $texte = nl2br( $texte ); $from.="MIME-Version: 1.0\r\n"; $from.="Content-Type: text/html"; $sujet="Question posée à la FCPE depuis le site internet"; if (mail($adresse,$sujet,$texte,$from))...comme derrière, il y a du code html, il y a ça dans le head <meta http-equiv="content-type" content="text/html;charset=utf-8">.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 <?php header('Content-Type: text/html; charset=utf-8'); ?>
Le fichier est encodé utf-8 sans BOM ; à la racine du site, j'ai mis ce .htaccess : AddDefaultCharset utf-8.
Et malgré tout ça, les caractères spéciaux sont mal affichés. Qu'est-ce qui ne va pas ?









Répondre avec citation

Partager