public function sendMessage(MailMessage $message) { @(require_once 'Mail.php'); $headers = array('From' => config::get('lepton.net.mail.from'), 'To' => join(',', $message->getRecipients()), 'Subject' => $message->getSubject()); $params = array('host' => config::get('lepton.net.mail.smtpserver', 'localhost'), 'port' => config::get('lepton.net.mail.smtpport', 25), 'localhost' => config::get('lepton.net.mail.localhost', 'localhost')); try { $omail =& Mail::factory('smtp', $params); $omail->send($message->getRecipients(), $headers, $message->getMessage()); } catch (Exception $e) { throw new MailException("Sending of mail failed"); } }