[討論]有關 "電子郵件通知 " 功能 與 UTF-8
發表於 : 2006-04-18 11:40
現時本人使用 .20版本, 加上 UTF-8的 Chinese-Traditional 語言包, 當使用 電子郵件通知 功能(MASS MAIL)時, 所傳出去的電郵是以 UTF-8傳送, 以致各使用者會收到亂碼之電郵, 請問各位有沒有試過這問題及如何解決?
http://www.php.net/manual/en/ref.mbstring.phpmischuinet 寫:另外, 我參考了這個MOD後, 再加了一些code, 可以在沒有mbstring 之下都可強行傳送big5郵件. 整理好後或會遲些作出分享.
代碼: 選擇全部
$this->subject = '=?'.$this->new_email_encode.'?B?' . base64_encode(mb_convert_encoding($this->subject, $this->new_email_encode, $lang['ENCODING'])).'?=';
$this->msg = mb_convert_encoding($this->msg, $this->new_email_encode, $lang['ENCODING']);
$this->extra_headers = mb_convert_encoding($this->extra_headers, $this->new_email_encode, $lang['ENCODING']);代碼: 選擇全部
$this->subject = '=?'.$this->new_email_encode.'?B?' . base64_encode(iconv( $lang['ENCODING'], $this->new_email_encode, $this->subject)).'?=';
$this->msg = iconv( $lang['ENCODING'], $this->new_email_encode, $this->msg);
$this->extra_headers = iconv( $lang['ENCODING'], $this->new_email_encode, $this->extra_headers);