Re: [PHP-I18N] mail-command and UTF-8
[email protected] (Darren Cook) Sun, 08 Mar 2009 16:34:56 +0900
| Newsgroups | php.i18n |
|---|---|
| Message-ID | <[email protected]> |
> $subject = mb_encode_mimeheader($subject,
> mb_internal_encoding(),"B","\n");
> return mail('[email protected]', $subject, $message, $header);
Sorry, I missed this earlier: if you have mb_encode_mimeheader() then
you also have mb_send_mail(), which does all the hard work for you.
http://php.net/mb_send_mail
http://jp.php.net/mb_language
So, this might replace almost (*) everything you wrote:
mb_language('uni');
mb_send_mail('[email protected]', $subject, $message);
Darren
*: Except the reply-to header. You can add that: mb_send_mail() takes
the same optional 4th parameter as mail().