summaryrefslogtreecommitdiff
path: root/it_mail.class
diff options
context:
space:
mode:
authorChristian Weber2012-03-22 15:35:37 +0000
committerChristian Weber2012-03-22 15:35:37 +0000
commitca11771e8fad5fef96615df4c44e04b8fb60ac31 (patch)
tree3924b3e2e12a5d5ea3b40890477d5e070498543c /it_mail.class
parent287d11f9e4ab47084c83a086baa15dcc057a8a07 (diff)
downloaditools-ca11771e8fad5fef96615df4c44e04b8fb60ac31.tar.gz
itools-ca11771e8fad5fef96615df4c44e04b8fb60ac31.tar.bz2
itools-ca11771e8fad5fef96615df4c44e04b8fb60ac31.zip
use PHP's default_charset instead of hard-coded iso-8859-1
Diffstat (limited to 'it_mail.class')
-rw-r--r--it_mail.class8
1 files 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 ?=?<charset>?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