Example #1
0
 /**
  * Sends notice-emails to the Receivers
  * @param  array(MessageAdminReceivers) $receivers
  * @return array(MessageAdminReceivers) the receivers were the email
  * couldnt be send to
  */
 private function sendEmails($receivers)
 {
     require_once PATH_INCLUDE . '/email/SMTPMailer.php';
     $usersNotSend = array();
     //the Email could not be send to these users
     $userdata = $this->sendEmailsFetchUserdata($receivers);
     $mailer = new SMTPMailer($this->_interface);
     $mailer->smtpDataInDatabaseLoad();
     $mailer->emailFromXmlLoad(PATH_INCLUDE . '/email/Babesk_Nachricht_Info.xml');
     foreach ($userdata as $user) {
         $mailer->AddAddress($user->email);
         if ($user->email != '' && $mailer->Send()) {
             //everything fine
         } else {
             $usersNotSend[] = $user;
         }
         $mailer->ClearAddresses();
     }
     return $usersNotSend;
 }