Added charset selection for email content.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 11 May 2010 11:32:07 +0000 (11:32 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 11 May 2010 11:32:07 +0000 (11:32 +0000)
reporting/includes/class.mail.inc

index 7e6be6f93a1d958a5c2e003196287d667e8d6799..7f3b77b1174430e6c6ca0891846150d4f47c6d99 100644 (file)
@@ -21,7 +21,8 @@ class email
     var $header = "";
     var $subject = "";
     var $body = "";
-
+       var $charset = 'ISO-8859-1';
+       
     function email($name, $mail)
     {
         $this->boundary = md5(uniqid(time()));
@@ -55,14 +56,14 @@ class email
 
     function text($text)
     {
-           $this->body = "Content-Type: text/plain; charset=ISO-8859-1\n";
+           $this->body = "Content-Type: text/plain; charset={$this->charset}\n";
            $this->body .= "Content-Transfer-Encoding: 8bit\n\n";
            $this->body .= $text."\n";
     }
 
     function html($html)
     {
-           $this->body = "Content-Type: text/html; charset=ISO-8859-1\n";
+           $this->body = "Content-Type: text/html; charset={$this->charset}\n";
            $this->body .= "Content-Transfer-Encoding: quoted-printable\n\n";
            $this->body .= "<html><body>\n".$html."\n</body></html>\n";
     }