From: Robert Kaiser Date: Sun, 27 Jan 2008 17:17:41 +0000 (+0100) Subject: fix saving of time_sent_latest for bounce messages X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=43bc07b3ee51f7d3f5ecd783b8195da26cc43f03;p=php-utility-classes.git fix saving of time_sent_latest for bounce messages --- diff --git a/include/classes/email.php-class b/include/classes/email.php-class old mode 100755 new mode 100644 index 0c485fe..2de9ca4 --- a/include/classes/email.php-class +++ b/include/classes/email.php-class @@ -172,11 +172,13 @@ class email { public function getAddresses($addrtype = null) { // returns all addresses this mail gets sent to - $addrtype = explode(',', strtolower($addrtype)); - if (!is_array($addrtype)) { $addrtype = array('to','cc','bcc'); } + if (!is_array($addrtype)) { + if (strlen($addrtype)) { $addrtype = explode(',', strtolower($addrtype)); } + else { $addrtype = array('to','cc','bcc'); } + } $mailaddresses = array(); - if (in_array($addrtype, 'to')) { + if (in_array('to', $addrtype)) { foreach ($this->recipients as $address) { if (strlen(@$address['mail'])) { $mailaddresses[] = array('mail'=>$address['mail'], @@ -185,7 +187,7 @@ class email { } } } - if (in_array($addrtype, 'cc')) { + if (in_array('cc', $addrtype)) { foreach ($this->cc as $address) { if (strlen(@$address['mail'])) { $mailaddresses[] = array('mail'=>$address['mail'], @@ -194,7 +196,7 @@ class email { } } } - if (in_array($addrtype, 'bcc')) { + if (in_array('bcc', $addrtype)) { foreach ($this->bcc as $address) { if (strlen(@$address['mail'])) { $mailaddresses[] = array('mail'=>$address['mail'], @@ -203,6 +205,8 @@ class email { } } } + + return $mailaddresses; } public function send() { @@ -334,7 +338,5 @@ class email { } return $mText; } - - } ?>