Bonjour à tous,
j'ai un problème lors de l'envoi d'un email en php via un formulaire, tous les accents sont changés en "i" :s
Je travaille en locale avec easyphp pour l'instant. Voici mon code :
Je ne vois pas d'où cela peut venir :s quelqu'un aurait une idée ?
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 $delim = md5(uniqid(rand())); $head = "MIME-Version: 1.0\n"; $head .= "Content-Type:multipart/mixed; boundary=\"$delim\"\n"; $head .= "\n"; $msg = "Ce message est au format MIME ... \n"; $msg .= "\n"; $msg .= "--$delim\n"; $msg .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $msg .= "Content-Transfer-Encoding:8bit\n"; $msg .= "\n\n"; $msg .= $message; $msg .= "\n"; [...] $attache = file_get_contents($fichier); $attache = chunk_split(base64_encode($attache)); $msg .= "--$delim\n"; $msg .= "Content-Type: $fichier_type; name=\"$fichier_nom\"\n"; $msg .= "Content-Transfer-Encoding: base64\n"; $msg .= "Content-Disposition: attachment; filename=\"$fichier_nom\"\n"; $msg .= "\n\n"; $msg .= $attache . "\n"; $msg .= "\n\n"; $msg .= "--$delim--\n"; [...] $envoi = mail($to, $sujet, $msg, "From: $from\n".$head);
Partager