我正在使用 php 邮件功能,它工作得很好,我真的不喜欢使用这个功能,但必须为此做。
所以问题是,特殊的欧洲字符在电子邮件中以一种有趣的方式显示,我试图将编码设置为 iso-8859-1,同样的情况正在发生:
$to = $eemail;
$subject = $campos[4];
$message = $campos[5];
$message = mb_convert_encoding($message, 'HTML-ENTITIES', 'iso-8859-1');
$from = $campos[1];
$headers = "From:".$from."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n";
剩下的是一个基本的邮件表单,通过 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;
});
});
出了什么问题?