Ethna_MailSender

2006年7月4日 (火曜日) - 18:54:58 by webmaster

このまま使うと自分とこの環境だと文字化けしちゃう。
ちょっと修正してみる。

Ethna_MailSender.phpの198行目から3行追加

function _parse($mail)
    {
+      if (!is_null($this->config->get('MailSender_internal_encoding'))) {
+         mb_internal_encoding($this->config->get('MailSender_internal_encoding'));
+      }
        list($header_line, $body) = preg_split('/\r?\n\r?\n/', $mail, 2);
        $header_line .= "\n";


Ethna_CsMailSenderとでもして保存しておけば、あとはproject-ini.phpの$configに

'MailSender_internal_encoding' => 'euc-jp',

を追加するだけで大丈夫(なはず)。文字コードは環境にあわせて変更して下さい。
setOptionを使う方法も試してみたけれど、こっちのほうが使うときに簡単。

One Response - “Ethna_MailSender”

  1. webmaster : 2006/07/04 - 21:21:53 -

    $this->config->get('key')を$this->config->get['key']で書いちゃった。いやぁ、ハマッたハマッた。(^^;

Leave a Reply

XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>