From 4957c77f74cc234020f9836075e6c5cc8a505a64 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 5 Nov 2012 08:48:13 +0000 Subject: [PATCH] allow to access ReplyTo of MailObject by extending classes; provide Function to retrieve replyTo Address; alter Method to detect wether a filename is already encoded, and if - do not try to use the basename as filename --- phpgwapi/inc/class.egw_mailer.inc.php | 15 +++++++++++++-- phpgwapi/inc/class.phpmailer.inc.php | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.egw_mailer.inc.php b/phpgwapi/inc/class.egw_mailer.inc.php index 2a74331808..b14cf870e6 100644 --- a/phpgwapi/inc/class.egw_mailer.inc.php +++ b/phpgwapi/inc/class.egw_mailer.inc.php @@ -199,6 +199,18 @@ class egw_mailer extends PHPMailer return parent::AddBCC($address, $name); } + /** + * Gets the "ReplyTo" addresses. + * + * Function to retrieve the ReplyTo Addresses of the SMT Mailobject + * + * @return array with the reply-to mail addresse(s)) + */ + public function GetReplyTo() + { + return $this->ReplyTo; + } + /** * Adds a string or binary attachment (non-filesystem) to the list. * This method can be used to attach ascii or binary data, @@ -214,7 +226,7 @@ class egw_mailer extends PHPMailer // Append to $attachment array //already encoded? //TODO: maybe add an parameter to AddStringAttachment to avoid using the basename - $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $filename, $matches); + $x += preg_match('/\?=.+=\?/', $filename); $this->attachment[] = array( 0 => $string, 1 => $filename, @@ -226,5 +238,4 @@ class egw_mailer extends PHPMailer 7 => 0 ); } - } diff --git a/phpgwapi/inc/class.phpmailer.inc.php b/phpgwapi/inc/class.phpmailer.inc.php index 45875b87db..2cfdd8feac 100644 --- a/phpgwapi/inc/class.phpmailer.inc.php +++ b/phpgwapi/inc/class.phpmailer.inc.php @@ -343,7 +343,7 @@ class PHPMailer { private $to = array(); private $cc = array(); private $bcc = array(); - private $ReplyTo = array(); + protected $ReplyTo = array(); //this way extended classes may use this variable private $all_recipients = array(); protected $attachment = array(); //this way extended classes may use this variable private $CustomHeader = array();