PHPMailer 字符编码问题
我尝试使用PHPMailer发送注册,激活。等邮件给用户:
require("class.phpmailer.php");
$mail -> charSet = "UTF-8";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.mydomain.org";
$mail->From = "name@mydomain.org";
$mail->SMTPAuth = true;
$mail->Username ="username";
$mail->Password="passw";
//$mail->FromName = $header;
$mail->FromName = mb_convert_encoding($header, "UTF-8", "auto");
$mail->AddAddress($emladd);
$mail->AddAddress("mytest@gmail.com");
$mail->AddBCC('mytest2@mydomain.org', 'firstadd');
$mail->Subject = $sub;
$mail->Body = $message;
$mail->WordWrap = 50;
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
}
包含拉丁字符。不幸的是,所有网络邮件(gmail,webmail.mydomain.org,emailaddress.domain.xx)都使用不同的编码。$message
如何强制使用 UTF-8 编码在所有邮箱上显示完全相同的邮件?
我试图转换邮件头宽度,但没有运气。mb_convert_encoding()