0

我想使用 PHP 发送主题为日文字符的电子邮件。我可以在发件人中使用日语字符发送,但是当我在主题中使用它时,电子邮件不会收到。我该如何解决这个问题。请帮忙。

谢谢,吉普

4

2 回答 2

2

使用 PHPmailer 库,我在使用 UTF8 字符时从未遇到过问题。http://phpmailer.worxware.com/

于 2012-07-07T16:23:03.720 回答
1

google 的第一个结果(对于“php unicode email”)

这是代码:

$headers['To'] = $to;
$headers['From'] = $from;
$headers['Content-Type'] = "text/plain; charset=utf-8";
$headers['Content-Transfer-Encoding'] = "8bit";
$b64subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
$headers['Subject'] = $b64subject;

$mail = Mail::factory('sendmail', array('host' => $host, 'port'=>$port));
$retval =  $mail->send($to, $headers, $body);
于 2012-07-07T16:18:41.043 回答