mail UTF8 標題亂碼
發表於 : 2010-10-19 09:31:52
http://bitprison.net/php_mail_utf-8_subject_and_message
把標題用 base64 編碼即可
代碼: 選擇全部
<?php
function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') {
$header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);
}
?>