/** * Launch notification * @return string */ public function notify() { if ($recipients = $this->_getRecipients()) { $body = JString::trim($this->renderBody()); if (empty($body)) { return null; } $this->_mailer->setSubject($this->_getMailSubject()); $this->_mailer->setSender($this->_getMailSender()); $this->_mailer->isHtml($this->_isHtml()); $this->_mailer->setBody($body); foreach ($recipients as $recEmail => $recName) { // send message $this->_mailer->addRecipient(array($recEmail, $recName)); $this->_mailer->send(); $this->_mailer->ClearAllRecipients(); if ($this->_isSleep()) { // simple antispam sleep(1); } } } }