原标题:PHPMailer发送邮件报错,如何解决Malformed UTF-8 characters, possibly incorrectly encoded
使用 PHPMailer 邮件发生报错,Malformed UTF-8 character文章来源地址https://www.yii666.com/learning/php/196.htmls, possiblywww.yii666.com incorre文章来源地址https://www.yii666.com/learning/php/196.htmlctly encoded
报错信息翻译过来是:UTF-8字符格式错误,可能编码错www.yii666.com误
解决方案
方法一:
将所有发送字符,转化为 utf-8
$content = mb_convert_encoding($content, 'UTF-8', 'UTF-8'); $content =&nb文章来源站点https://www.yii666.com/sp;mb_convert_encoding($content, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' );
方法二:
将字符转化为 GBK 后再转回 UTF-8
方法三:
换一个发送邮箱的服务器,如使用QQ【解决了】
来源于:PHPMailer发送邮件报错,如何解决Malformed UTF-8 characters, possibly incorrectly encoded