(PHP 4 >= 4.0.6, PHP 5)
mb_language — 设置/获取当前的语言
language
用于编码邮件信息。有效的语言有:"Japanese","ja","English","en" 和 "uni"(UTF-8)。 mb_send_mail() 使用了该设置来对邮件进行编码。
语言和它的设置,日文是 ISO-2022-JP/Base64,uni 是 UTF-8/Base64,英文是 ISO-8859-1/quoted。
如果设置了 language
,并且 language
是有效的,它将返回 TRUE
。否则将返回 FALSE
。
当省略了 language
参数,它将返回语言名称的 string。如果之前没有设置过语言,则将返回 FALSE
。
kitchin (2011-05-22 09:17:12)
Can return 'neutral', which apparently means UTF-8.
Sohel Taslim (2007-09-18 22:52:35)
It can help you to send an email as with Japanese contain.
<?php
mb_language("ja");
$subject = mb_convert_encoding($subject, "ISO-2022-JP","AUTO");
$subject = mb_encode_mimeheader($subject);
$result = mail($to, $subject, $body, $headers, $sendmail_params);
?>