add handling for mails that have no valid recipient when we try to send them
authorRobert Kaiser <kairo@kairo.at>
Mon, 8 Oct 2007 01:08:09 +0000 (03:08 +0200)
committerRobert Kaiser <kairo@kairo.at>
Mon, 8 Oct 2007 01:08:09 +0000 (03:08 +0200)
include/classes/email.php-class

index a2defcecfdf0720e51739e4f108ab746fee3841c..c7e1ee4f657e3d95fef5d852bde131b84267f09f 100755 (executable)
@@ -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) {