Jump to content

Formulário de Contacto com caracteres esquisitos


Recommended Posts


Estou a implementar no meu site um formulário de contacto...

O problema está que quando eu escrevo na caixa da message e faço "enviar mensagem" ele envia só que o que me chega ao email é a minha mensagem com caracteres esquisitos.

Exemplo: Mensagem-> a técnica do cão é o leão; Mensagem que me chega ao email: a técnica do Cão é o leão

Alguma sugestão...



    //we need to get our variables first
    $email_to =   'xx1@gmail.com'; //the address to which the email will be sent
    $name     =   $_POST['name'];  
    $email    =   $_POST['email'];
    $subject  =   $_POST['subject'];
$local  =   $_POST['local'];
$data  =   $_POST['data'];
$hora  =   $_POST['hora'];
    $message  =   $_POST['message'];

 $subject = "Proposta e Orçamento ($subject, $local, $data, $hora)";
 $message = "$message";

$email_to =   " $email";
    /*the $header variable is for the additional headers in the mail function,
     we are asigning 2 values, first one is FROM and the second one is REPLY-TO.
     That way when we want to reply the email gmail(or yahoo or hotmail...) will know 
     who are we replying to. */
    $headers  = "From: $email\r\n";
    $headers .= "Reply-To: $email\r\n";
    if(mail($email_to, $subject, $message, $headers)){
        echo 'sent'; // we are sending this text to the ajax request telling it that the mail is sent..      
        echo 'failed';// ... or this one to tell it that it wasn't sent    
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.