问题描述
=?UTF-8?GAMEFORCE 會員更改密碼通知?GAMEFORCE 會員更改密碼通知?= , 用phpmailer发送的邮件的标题总是带这些额外的字符。
问题出现的环境背景及自己尝试过哪些方法
$mail->CharSet = "utf-8",$mail->Subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
有试过设置字符集,但是邮件标题还是带这些字符。
$mail = new Mail_PHPMailer();
$mail->CharSet = "utf-8";
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $config['hostname'];
$mail->Username = $config['username'];
$mail->Password = $config['password'];
$mail->SetFrom($config['username']);
$mail->AddAddress($email);
$mail->Subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
$mail->MsgHTML($content);
return $mail->Send();
我感觉是你自己写上去的啊老哥 你为什么要encode发送的标题呢