From ca11771e8fad5fef96615df4c44e04b8fb60ac31 Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Thu, 22 Mar 2012 15:35:37 +0000 Subject: use PHP's default_charset instead of hard-coded iso-8859-1 --- it_mail.class | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/it_mail.class b/it_mail.class index 20aa43a..5045a44 100644 --- a/it_mail.class +++ b/it_mail.class @@ -56,7 +56,7 @@ class it_mail var $cc = array(); var $bcc = array(); var $flags = ""; - var $charset = 'iso-8859-1'; + var $charset; /** * Construct a new email message. Headers and body can be added later. @@ -65,6 +65,8 @@ class it_mail */ function it_mail($headers = array()) { + $this->charset = ini_get('default_charset'); + foreach ((array)$headers as $header => $value) $this->add_header($header, $value); } @@ -298,7 +300,7 @@ function send($p = array()) /** - * INTERNAL: Escape header line with ?=iso-8859-1? if necessary, e.g. in Subject line + * INTERNAL: Escape header line with ?=??Q if necessary, e.g. in Subject line * @param $string String to be escaped * @return String escape suitable for sending in header line */ @@ -320,6 +322,7 @@ function header_escape($string, $emailmode = false) return $result; } + /** * Make string safe to be used in "$fullname <$email>": Remove illegal * characters and enclose in double quotes. @@ -331,6 +334,7 @@ function fullname_escape($string) return '"' . preg_replace('/["\x00-\x1f]/', '', $string) . '"'; } + /** * INTERNAL: Send SMTP command and return true if result is 2XX * @param $fp Connection to SMTP server opened using fsockopen -- cgit v1.2.3