Home > Backend Development > PHP Tutorial > 中文乱码问题:帮忙看一下是哪里出错了,谢谢了

中文乱码问题:帮忙看一下是哪里出错了,谢谢了

WBOY
Release: 2016-06-23 14:04:40
Original
877 people have browsed it

最近用php做了一个网站,用到phpmail发邮件,发到163里面去,可是打开163邮箱中文全是乱码,网上的方法都用遍了,什么用函数base64_encode() ? 使用 MIME base64 对数据进行编码,标题字符串前加编码类型例如: =?UTF-8?B?,标题字符串后加:?=,没用,我把utf-8和gbk还有什么gb1232换来换去,还是没用,我都不知道该怎么解决了?


回复讨论(解决方案)

你在 phpmail 中指定了错误的字符集

用php里的mail函数直接发很简单啊,不一定要用phpmail吧,例子

<?php$to      = 'nobody@example.com';$subject = 'the subject';$message = 'hello';$headers = 'From: webmaster@example.com' . "\r\n" .    'Reply-To: webmaster@example.com' . "\r\n" .    'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);?> 
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template