我有一个PHP邮件脚本,发送电子邮件,我需要发送一些在中国。我有以下代码:
$email_header = "From: $from\n";
$email_header .= "X-Priority: 1\n"; //1 UrgentMessage, 3 Normal
$email_header .= "Return-Path: <$return>\n";
$email_header .= "Content-type: text/html; charset=utf-8\n";
mail($row["email"], '=?UTF-8?B?'.base64_encode($subject).'?=', $email_body, $email_header);我的问题是电子邮件的主题和正文都有问题-它发送的内容如下:
Subject: ???????????
Body: ???????????????
?????
??????????????????????????????????????????????????
????? 显然不是中文!如果有人能给我指出正确的方向,那就太好了。
提前谢谢你,
荷马。
发布于 2011-04-21 22:54:33
看起来像是数据库连接问题,而不是邮件程序问题。也许忘了做set names utf-8...?
https://stackoverflow.com/questions/5745540
复制相似问题