解决Discuz utf8版的邮件乱码问题

因论坛每天都有自动注册的用户[应该是用来发送垃圾信息的],于时把论坛的用户注册改为了Email验证,因论坛编码是UTF-8编码,在测试时发现用户收到的验证Email是乱码,Google了一下,找到了解决方法,如下:
==========================================================
修改include/sendmail.inc.php文件,找

$email_subject = str_replace(“\r”, ”, str_replace(“\n”, ”, $email_subject));

低下添加

$email_subject = “=?UTF-8?B?”.base64_encode($email_subject).”?=”;

@mail($email_to, $email_subject, $email_message,”From: $email_from”)

修改为

@mail($email_to, $email_subject, $email_message, “MIME-Version: 1.0\n” .”From: $email_from” . “\n” . “Content-Type: text/plain; charset=utf-8\n”);

==========================================================

发表评论

电子邮件地址不会被公开。 必填项已用*标注