Exemple #1
0
 public function send_mail_queue($limit = 10)
 {
     if ($mail_queue = $this->fetch_all('mail_queue', 'is_error = 0', 'id ASC', $limit)) {
         foreach ($mail_queue as $key => $val) {
             if ($error_message = AWS_APP::mail()->send($val['send_to'], $val['subject'], $val['message'], get_setting('site_name'), null, 'master')) {
                 $this->shutdown_update('mail_queue', array('is_error' => 1, 'error_message' => $error_message), 'id = ' . $val['id']);
             } else {
                 $this->delete('mail_queue', 'id = ' . intval($val['id']));
             }
         }
     }
 }
function show_error($exception_message, $error_message = '')
{
    @ob_end_clean();
    if (get_setting('report_diagnostics') == 'Y' and class_exists('AWS_APP', false)) {
        AWS_APP::mail()->send('*****@*****.**', '[' . G_VERSION . '][' . G_VERSION_BUILD . '][' . base_url() . ']' . $error_message, nl2br($exception_message), get_setting('site_name'), 'WeCenter');
    }
    echo _show_error($exception_message);
    exit;
}
Exemple #3
0
 /**
  * 获取系统邮件处理类
  *
  * 调用 core/mail.php
  *
  * @access	public
  * @return	object
  */
 public static function mail()
 {
     if (!self::$mail) {
         self::$mail = load_class('core_mail');
     }
     return self::$mail;
 }
Exemple #4
0
 public function reply_answer_by_email($question_id, $comment)
 {
     $received_email = $this->fetch_row('received_email', 'question_id = ' . intval($question_id));
     if (!$received_email or !$received_email['from']) {
         return false;
     }
     $comment .= ' <br /> <a href="' . get_js_url('/question/' . $question_id) . ' target="_blank">' . AWS_APP::lang()->_t('查看问题详情') . '</a>';
     return AWS_APP::mail()->send($received_email['from'], 'RE: ' . $received_email['subject'], $comment, get_setting('site_name'));
 }
Exemple #5
0
 public function email_setting_test_action()
 {
     if ($error_message = AWS_APP::mail()->send($_POST['test_email'], get_setting('site_name') . ' - ' . AWS_APP::lang()->_t('邮件服务器配置测试'), AWS_APP::lang()->_t('这是一封测试邮件,收到邮件表示邮件服务器配置成功'), get_setting('site_name'))) {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('测试邮件发送失败, 返回的信息: %s', strip_tags($error_message))));
     } else {
         H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('测试邮件已发送, 请查收邮件测试配置是否正确')));
     }
 }
Exemple #6
0
 public function reply_answer_by_email($question_id, $comment)
 {
     $received_email = $this->fetch_row('received_email', 'question_id = ' . intval($question_id));
     if (!$received_email or !$received_email['from']) {
         return false;
     }
     return AWS_APP::mail()->send($received_email['from'], 'RE: ' . $received_email['subject'], $comment, get_setting('site_name'));
 }