From ba79b48c782b861d2086d19ac496a9fecb09e403 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Mon, 8 Oct 2007 03:08:09 +0200 Subject: [PATCH] add handling for mails that have no valid recipient when we try to send them --- include/classes/email.php-class | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) { -- 2.35.3