Pages

Jumaat, 12 Mac 2010

How to send an email with arabic content in PHP script

Today's learning is about how to send an email with arabic content in PHP.

Check your htmlMimeMail setting. maybe you some file name htmlMimeMail.php. then

you just go to that file, do change:

Before:

        $this->build_params['text_encoding'] = '7bit';
        $this->build_params['html_charset']  = 'ISO-8859-1';
        $this->build_params['text_charset']  = 'ISO-8859-1';
        $this->build_params['head_charset']  = 'ISO-8859-1';


After:

        $this->build_params['text_encoding'] = '8bit';
        $this->build_params['html_charset'] = 'utf-8';
        $this->build_params['text_charset'] = 'utf-8';
        $this->build_params['head_charset'] = 'utf-8';


You can also set your header as below :

header('Content-type: text/html; charset=utf-8');

Before:




After:

Tiada ulasan: