I'm using the php mail function, it works kinda fine, i really don't like to use this function but will have to do for this one.
So the problem is, the special european characters are being shown in a funny way on the email, i tried to set the codification to iso-8859-1 and the same is happening:
$to = $eemail;
$subject = $campos[4];
$message = $campos[5];
$message = mb_convert_encoding($message, 'HTML-ENTITIES', 'iso-8859-1');
$from = $campos[1];
$headers = "From:".$from."
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type: text/html; charset=ISO-8859-1
";
$headers .= "X-Priority: 3
";
$headers .= "X-Mailer: PHP". phpversion() ."
";
The rest is a basic mail form, sent through AJAX:
$(function() {
$(".submita").click(function() {
var nome = $('#nome').attr('value');
var email = $('#email').attr('value');
var telemovel = $('#telemovel').attr('value');
var loja = $('#loja').attr('value');
var assunto = $('#assunto').attr('value');
var mensagem = $('#mensagem').attr('value');
var dataString = 'nome='+ nome + '&email=' + email + '&telemovel=' + telemovel + '&loja=' + loja + '&assunto=' + assunto + '&mensagem=' + mensagem;
$.ajax({
type: "POST",
url: "ajaxload/conemail.php",
data: dataString,
success: function() {
$(".mensagem").fadeIn();
}
});
return false;
});
});
What is going wrong?