note 97847 added to function.mail
| From: | zhangjiayin99 at gmail dot com | Date: | Wed, 12 May 2010 04:47:24 +0000 |
| Subject: | note 97847 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-169166@lists.php.net to get a copy of this message | ||
function mail_utf8($to, $subject = '(No subject)', $message = '', $from,
$from_name) {
$header = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/plain;
charset=UTF-8'
. "\n" . 'From: "'. '=?UTF-8?B?' .
base64_encode($from_name) . '?=' . '" <' . $from . ">\n";
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header);
}
I see the function some one wrote ,
when I use it , it look like good for mail body with chinese , but the from name, so I change it
,the from name should be encode, I really didn't know why mb_encode_mimeheader not effected
----
Server IP: 69.147.83.197
Probable Submitter: 119.161.224.219
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/97847
Del: integrated -- https://master.php.net/note/delete/97847/integrated
Del: useless -- https://master.php.net/note/delete/97847/useless
Del: bad code -- https://master.php.net/note/delete/97847/bad+code
Del: spam -- https://master.php.net/note/delete/97847/spam
Del: non-english -- https://master.php.net/note/delete/97847/non-english
Del: in docs -- https://master.php.net/note/delete/97847/in+docs
Del: other reasons-- https://master.php.net/note/delete/97847
Reject -- https://master.php.net/note/reject/97847
Search -- https://master.php.net/manage/user-notes.php