logException() public static method

Logs an exception as if it was thrown.
public static logException ( $exception )
$exception
示例#1
0
 /**
  * Mailer:mail is intended as a more robust simple replacement for php mail(),
  * @param array $to address eg array('*****@*****.**'=>'OpenEyes')
  * @param string $subject
  * @param string $body
  * @param array $from address eg array('*****@*****.**'=>'OpenEyes')
  * @return bool mail sent without error
  */
 public static function mail($to, $subject, $body, $from)
 {
     try {
         $message = Yii::app()->mailer->newMessage();
         $message->setSubject($subject);
         $message->setFrom($from);
         $message->setTo($to);
         $message->setBody($body);
         Yii::app()->mailer->sendMessage($message);
     } catch (Exception $Exception) {
         OELog::logException($Exception);
         return false;
     }
     return true;
 }