Jump to content

Encoding...?


eoran

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.