Code snippets for symfony 1.x


Refine Tags

Snippets tagged "iso2022jp"

How to use sfMail to encode body of Japanese Email.

How to use sfMail to encode Body of Japanese Email.

The Japanese Email usually use ISO-2022-JP. But, I want to use UTF-8 of any Email template files. For example...

I create PROJECT_DIR/lib/myMail.class.php


class myMail extends sfMail
  public function setBody ($body)
    parent::setBody(mb_convert_encoding($body, "JIS", "UTF-8"));

OK, Use this class from your Action.


  public function executeSendmail()
    $mail = new myMail();
by Kota Sakoda on 2007-02-13, tagged email  encode  iso2022jp  japanese  sfmail  utf8