eoran Posted April 26, 2007 Share Posted April 26, 2007 I have a php document for an email form that works just fine, except that in the content of the email I receive, I get the accents replaced by question marks. I don't know why, I think the encoding is set as UTF 8... Any help will be strongly appreciated!! Here's the php: <?php if(isset($_POST["nombre"]) && isset($_POST["asunto"]) && isset($_POST["email"]) && isset($_POST["descripcion"]) ){ $fecha = date("D-M-y H:i"); $mymail = "[email protected]"; $subject = $_POST["asunto"]."\n\n"; $contenido .= "Nombre: ".$_POST["nombre"]."\n"; $contenido .= "Matricula: ".$_POST["matricula"]."\n"; $contenido .= "Licenciatura: ".$_POST["licenciatura"]."\n"; $contenido .= "Descripción: ".$_POST["descripcion"]."\n"; $contenido .= "Fecha: ".$fecha; $header = "From:".$_POST["email"]."\nReply-To:".$_POST["email"]."\n"; $header .= "X-Mailer:PHP/".phpversion()."\n"; $header .= "Mime-Version: 1.0\n"; $header .= "Content-type: text/plain"; mail($mymail, $subject, utf8_decode($contenido) ,$header); include "confirmacion.html"; } ?> Link to comment https://forums.phpfreaks.com/topic/48801-encoding/ Share on other sites More sharing options...
per1os Posted April 26, 2007 Share Posted April 26, 2007 $header .= "Content-type: text/plain;charset=utf-8'"; Link to comment https://forums.phpfreaks.com/topic/48801-encoding/#findComment-239195 Share on other sites More sharing options...
eoran Posted April 26, 2007 Author Share Posted April 26, 2007 Still, this is what I get as my email content: Nombre: Juan L? Matricula: 1105016 Licenciatura: producci?nimal Descripci?funcion?echa: Thu-Apr-07 13:41 Insteadof: Nombre: Juan López Matricula: 1105016 Licenciatura: producción animal Descripción: funcionó? Fecha: Thu-Apr-07 13:41 ??? Link to comment https://forums.phpfreaks.com/topic/48801-encoding/#findComment-239233 Share on other sites More sharing options...
per1os Posted April 26, 2007 Share Posted April 26, 2007 The form you are submitting to send it, you need to make sure the charset there is also UTF-8. If you are submitting in something other than utf-8 the characters will not coincide with each other. Link to comment https://forums.phpfreaks.com/topic/48801-encoding/#findComment-239329 Share on other sites More sharing options...
eoran Posted April 27, 2007 Author Share Posted April 27, 2007 Yes, my html form is also set in UTF-8... ??? Link to comment https://forums.phpfreaks.com/topic/48801-encoding/#findComment-239480 Share on other sites More sharing options...
eoran Posted April 27, 2007 Author Share Posted April 27, 2007 OK now I can see the accents but only for select menus... what the user writes in the input text field still isn't codified as UTF-8... Link to comment https://forums.phpfreaks.com/topic/48801-encoding/#findComment-239483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.