From: Robert Kaiser Date: Mon, 8 Oct 2007 01:08:09 +0000 (+0200) Subject: add handling for mails that have no valid recipient when we try to send them X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=ba79b48c782b861d2086d19ac496a9fecb09e403;p=php-utility-classes.git add handling for mails that have no valid recipient when we try to send them --- diff --git a/include/classes/email.php-class b/include/classes/email.php-class index a2defce..c7e1ee4 100755 --- a/include/classes/email.php-class +++ b/include/classes/email.php-class @@ -182,11 +182,16 @@ class email { if (count($this->recipients)) { $recpt = ''; foreach ($this->recipients as $address) { - if (strlen($address['name'])) { $recpt .= $this->mimeencode($address['name'], true).' <'.$address['mail'].'>,'; } - else { $recpt .= $address['mail'].','; } + if (strlen(@$address['mail'])) { + if (strlen($address['name'])) { $recpt .= $this->mimeencode($address['name'], true).' <'.$address['mail'].'>,'; } + else { $recpt .= $address['mail'].','; } + } } $recpt = preg_replace('/,$/', '', $recpt); } + if (!strlen($recpt)) { + return null; + } if (count($this->cc)) { $adrs = ''; foreach ($this->cc as $address) {