Пример #1
0
 public function notify(Exception $e)
 {
     if (isset(Bbx_Config::get()->site->support_address) && APPLICATION_ENV != 'development') {
         try {
             $mail = Bbx_Mail::instance();
             $mail->setFrom('error@' . Bbx_Config::get()->site->location, Bbx_Config::get()->site->location);
             $mail->setBodyText($this->getRequest()->getRequestUri() . "\n\n" . $e->getMessage());
             $mail->addTo(Bbx_Config::get()->site->support_address);
             $mail->setSubject('Error at ' . Bbx_Config::get()->site->location);
             $mail->sendAsync();
         } catch (Exception $exc) {
             Bbx_Log::debug(print_r($e, true));
             Bbx_Log::debug("Couldn't send mail: " . $exc->getMessage());
         }
     } else {
         Bbx_Log::debug(print_r($e, true));
     }
 }
Пример #2
0
<?php

require 'init.php';
$mail = Bbx_Mail::instance();
$mail->setFrom((string) $argv[1])->setBodyText((string) $argv[3])->setSubject((string) $argv[4]);
foreach (explode(',', (string) $argv[2]) as $to) {
    $mail->addTo($to);
}
try {
    $mail->send();
} catch (Exception $e) {
    Bbx_Log::write("Couldn't send mail: " . $e->getMessage());
}