Exemplo n.º 1
0
 public function sendAlert(Alert $alert)
 {
     $email = new Email();
     $mailAddresses = explode(",", EMAILS);
     foreach ($mailAddresses as $mailAddress) {
         $email->addReceiver($mailAddress);
     }
     $email->setSender('*****@*****.**');
     $email->addSubject($alert->getTitle());
     $email->addMessage($alert->getAlert());
     $email->setHtmlHeader();
     $this->_emailManager->sendEmail($email);
 }
Exemplo n.º 2
0
 public function sendEmail(Email $email)
 {
     // 		echo $email->getHeaders();
     // 		echo "<BR>";
     // 		echo $email->getMessage();
     // 		echo "<BR>";
     // 		echo $email->getReceivers();
     // 		echo "<BR>";
     // 		echo $email->getSubject();
     $logManager = LogManager::getInstance();
     if (mail($email->getReceivers(), $email->getSubject(), $email->getMessage(), $email->getHeaders())) {
         $logManager->log(new \DateTime(), "email", "send Success");
     } else {
         $logManager->log(new \DateTime(), "email", "send fail" . $email->getMessage());
     }
 }