summaryrefslogtreecommitdiff
path: root/program/lib/Mail/mime.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-09-29 07:38:16 +0000
committeralecpl <alec@alec.pl>2008-09-29 07:38:16 +0000
commitffae15e5fcde50cf8c1b168fa313f4ec3454a693 (patch)
tree88f81d19eb5ebc41710fb9a161b054881ba5e3bd /program/lib/Mail/mime.php
parent29e697b24a68d7fca600f88ebc913b3ba5240f50 (diff)
- Added 'mime_param_folding' option with possibility to choose
long/non-ascii attachment names encoding eg. to be readable in MS Outlook/OE (#1485320) - Added "advanced options" feature in User Preferences
Diffstat (limited to 'program/lib/Mail/mime.php')
-rw-r--r--program/lib/Mail/mime.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/program/lib/Mail/mime.php b/program/lib/Mail/mime.php
index 7641b0c9b..688c326a5 100644
--- a/program/lib/Mail/mime.php
+++ b/program/lib/Mail/mime.php
@@ -323,6 +323,8 @@ class Mail_mime
* of this attachment.
* @param string $language The language of the attachment
* @param string $location The RFC 2557.4 location of the attachment
+ * @param string $n_encoding Use RFC 2047 for attachment name (Content-Type) encoding
+ * @param string $f_encoding Use RFC 2047 for attachment filename (Content-Disposition) encoding
*
* @return mixed true on success or PEAR_Error object
* @access public
@@ -335,7 +337,9 @@ class Mail_mime
$disposition = 'attachment',
$charset = '',
$language = '',
- $location = '')
+ $location = '',
+ $n_encoding = NULL,
+ $f_encoding = NULL)
{
$filedata = ($isfile === true) ? $this->_file2str($file)
: $file;
@@ -363,7 +367,9 @@ class Mail_mime
'charset' => $charset,
'language' => $language,
'location' => $location,
- 'disposition' => $disposition
+ 'disposition' => $disposition,
+ 'name-encoding' => $n_encoding,
+ 'filename-encoding'=> $f_encoding
);
return true;
}
@@ -532,6 +538,12 @@ class Mail_mime
$params['disposition'] = 'inline';
$params['dfilename'] = $value['name'];
$params['cid'] = $value['cid'];
+ if ($value['name-encoding']) {
+ $params['name-encoding'] = $value['name-encoding'];
+ }
+ if ($value['filename-encoding']) {
+ $params['filename-encoding'] = $value['filename-encoding'];
+ }
$ret = $obj->addSubpart($value['body'], $params);
return $ret;
@@ -561,6 +573,12 @@ class Mail_mime
if ($value['location']) {
$params['location'] = $value['location'];
}
+ if ($value['name-encoding']) {
+ $params['name-encoding'] = $value['name-encoding'];
+ }
+ if ($value['filename-encoding']) {
+ $params['filename-encoding'] = $value['filename-encoding'];
+ }
$params['content_type'] = $value['c_type'];
$params['disposition'] = isset($value['disposition']) ?
$value['disposition'] : 'attachment';
@@ -914,7 +932,6 @@ class Mail_mime
*/
function _encodeHeaders($input, $params = array())
{
-
$build_params = $this->_build_params;
while (list($key, $value) = each($params)) {
$build_params[$key] = $value;