當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Email::send_sys_email方法代碼示例

本文整理匯總了PHP中Email::send_sys_email方法的典型用法代碼示例。如果您正苦於以下問題:PHP Email::send_sys_email方法的具體用法?PHP Email::send_sys_email怎麽用?PHP Email::send_sys_email使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Email的用法示例。


在下文中一共展示了Email::send_sys_email方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: send_notice

 /**
  * 係統通知發送函數
  *
  * @param int $receiver_id 接受人編號
  * @param string $tpl_code 模板標識碼
  * @param array $param 內容數組
  * @param bool $flag 是否遵從係統設置
  * @return boolean
  */
 protected function send_notice($receiver_id, $tpl_code, $param, $flag = true)
 {
     $mail_tpl_model = Model('mail_templates');
     $mail_tpl = $mail_tpl_model->getOneTemplates($tpl_code);
     if (empty($mail_tpl) || $mail_tpl['mail_switch'] == 0) {
         return false;
     }
     $member_model = Model('member');
     $receiver = $member_model->infoMember(array('member_id' => $receiver_id));
     if (empty($receiver)) {
         return false;
     }
     $subject = ncReplaceText($mail_tpl['title'], $param);
     $message = ncReplaceText($mail_tpl['content'], $param);
     //根據模板裏麵確定的通知類型采用對應模式發送通知
     $result = false;
     switch ($mail_tpl['type']) {
         case '0':
             $email = new Email();
             $result = true;
             if ($flag and $GLOBALS['setting_config']['email_enabled'] == '1' or $flag == false) {
                 $result = $email->send_sys_email($receiver['member_email'], $subject, $message);
             }
             break;
         case '1':
             $model_message = Model('message');
             $param = array('member_id' => $receiver_id, 'to_member_name' => $receiver['member_name'], 'msg_content' => $message, 'message_type' => 1);
             $result = $model_message->saveMessage($param);
             break;
     }
     return $result;
 }
開發者ID:Maplecms,項目名稱:shopnc-yhmall,代碼行數:41,代碼來源:control.php

示例2: sendMail

 /**
  * 發送郵件
  * @param unknown $number
  * @param unknown $subject
  * @param unknown $message
  */
 private function sendMail($number, $subject, $message)
 {
     // 即時發動代碼  v3-b11
     $email = new Email();
     $email->send_sys_email($number, $subject, $message);
     // 計劃任務代碼
     $insert = array();
     $insert['mail'] = $number;
     $insert['subject'] = $subject;
     $insert['contnet'] = $message;
     Model('mail_cron')->addMailCron($insert);
 }
開發者ID:1290800466,項目名稱:mac_win,代碼行數:18,代碼來源:sendstoremsg.php

示例3: indexOp

 /**
  * 發送消息
  */
 public function indexOp() {
     $model_storemsgcron = Model('mail_cron');
     $cron_array = $model_storemsgcron->getMailCronList(array(), $this->_num);
     if (!empty($cron_array)) {
         $email = new Email();
         $mail_array = array();
         foreach ($cron_array as $val) {
             $return = $email->send_sys_email($val['mail'],$val['subject'],$val['contnet']);
             if ($return) {
                 // 記錄需要刪除的id
                 $mail_array[] = $val['mail_id'];
             }
         }
         // 刪除已發送的記錄
         $model_storemsgcron->delMailCron(array('mail_id' => array('in', $mail_array)));
     }
 }
開發者ID:noikiy,項目名稱:ejia,代碼行數:20,代碼來源:mail.php

示例4: send_auth_codeOp

 /**
  * 統一發送身份驗證碼
  */
 public function send_auth_codeOp()
 {
     if (!in_array($_GET['type'], array('email', 'mobile'))) {
         exit;
     }
     $model_member = Model('member');
     $member_info = $model_member->getMemberInfoByID($_SESSION['member_id'], 'member_email,member_mobile');
     $verify_code = rand(100, 999) . rand(100, 999);
     $data = array();
     $data['auth_code'] = $verify_code;
     $data['send_acode_time'] = TIMESTAMP;
     $update = $model_member->editMemberCommon($data, array('member_id' => $_SESSION['member_id']));
     if (!$update) {
         exit(json_encode(array('state' => 'false', 'msg' => '係統發生錯誤,如有疑問請與管理員聯係')));
     }
     $model_tpl = Model('mail_templates');
     $tpl_info = $model_tpl->getTplInfo(array('code' => 'authenticate'));
     $param = array();
     $param['send_time'] = date('Y-m-d H:i', TIMESTAMP);
     $param['verify_code'] = $verify_code;
     $param['site_name'] = C('site_name');
     $subject = ncReplaceText($tpl_info['title'], $param);
     $message = ncReplaceText($tpl_info['content'], $param);
     if ($_GET['type'] == 'email') {
         $email = new Email();
         $result = $email->send_sys_email($member_info["member_email"], $subject, $message);
     } elseif ($_GET['type'] == 'mobile') {
         $sms = new Sms();
         $result = $sms->send($member_info["member_mobile"], $message);
     }
     if ($result) {
         exit(json_encode(array('state' => 'true', 'msg' => '驗證碼已發出,請注意查收')));
     } else {
         exit(json_encode(array('state' => 'false', 'msg' => '驗證碼發送失敗')));
     }
 }
開發者ID:Maplecms,項目名稱:shopnc-api,代碼行數:39,代碼來源:security.php

示例5: forget_passwordOp

 /**
  * 忘記密碼
  */
 public function forget_passwordOp()
 {
     if (isset($_POST) && !empty($_POST)) {
         $model = Model();
         $store = $model->table('store')->where(array('account' => trim($_POST['account']), 'email' => trim($_POST['email'])))->find();
         if (empty($store)) {
             //驗證是否存在
             $this->showTip(L('nc_member_store_account_email_is_wrong'), 'index.php?act=slogin', 'succ');
         }
         $code = md5(trim($_POST['account']) . time());
         $flag = $model->table('store')->where(array('account' => trim($_POST['account'])))->update(array('email_code' => $code));
         $result = false;
         if ($flag && $GLOBALS['setting_config']['email_enabled'] == '1') {
             $email = new Email();
             $subject = $GLOBALS['setting_config']['site_name'] . Language::get('nc_forget');
             $rurl = BASE_SITE_URL . '/index.php?act=slogin&op=resetpassword&code=' . $code;
             $message = Language::get('nc_password_message_1') . '<a href="' . $rurl . '" target="_blank">' . $rurl . '</a><br>' . Language::get('nc_password_message_2');
             $message .= Language::get('nc_password_message_3') . '【<a href="' . BASE_SITE_URL . '" target="_blank">' . $GLOBALS['setting_config']['site_name'] . '</a>】';
             $result = $email->send_sys_email(trim($_POST['email']), $subject, $message);
         }
         if ($result) {
             $this->showTip(Language::get('nc_forget_up_submit'), 'index.php?act=slogin', 'succ');
         } else {
             $this->showTip(Language::get('nc_forget_up_fail'), 'index.php?act=slogin&op=forget_password', 'html', 'error');
         }
     }
     Tpl::output('sign', 'forget_password');
     Tpl::showpage('sforget_password');
 }
開發者ID:noikiy,項目名稱:shopnc-2,代碼行數:32,代碼來源:slogin.php

示例6: send_notice

 /**
  * 係統通知發送函數
  *
  * @param int $receiver_id 接受人編號
  * @param string $tpl_code 模板標識碼
  * @param array $param 內容數組
  * @return bool
  */
 public function send_notice($receiver_id, $tpl_code, $param)
 {
     /**
      * 獲取通知內容模板
      */
     $mail_tpl_model = Model('mail_templates');
     $mail_tpl = $mail_tpl_model->getOneTemplates($tpl_code);
     if (empty($mail_tpl) || $mail_tpl['mail_switch'] == 0) {
         return false;
     }
     /**
      * 獲取接收人信息
      */
     $member_model = Model('member');
     $receiver = $member_model->infoMember(array('member_id' => $receiver_id));
     if (empty($receiver)) {
         return false;
     }
     /**
      * 為通知模板的主題與內容中變量賦值
      */
     $subject = ncReplaceText($mail_tpl['title'], $param);
     $message = ncReplaceText($mail_tpl['content'], $param);
     /**
      * 根據模板裏麵確定的通知類型采用對應模式發送通知
      */
     $result = false;
     switch ($mail_tpl['type']) {
         case '0':
             $email = new Email();
             $result = $email->send_sys_email($receiver['member_email'], $subject, $message);
             break;
         case '1':
             $model_message = Model('message');
             $param = array('member_id' => $receiver_id, 'to_member_name' => $receiver['member_name'], 'msg_content' => $message, 'message_type' => 1);
             $result = $model_message->saveMessage($param);
             break;
     }
     return $result;
 }
開發者ID:dw250100785,項目名稱:shopnc,代碼行數:48,代碼來源:control.php

示例7: find_passwordOp

 /**
  * 找回密碼的發郵件處理
  */
 public function find_passwordOp()
 {
     Language::read('home_login_register');
     $lang = Language::getLangContent();
     $result = chksubmit(true, true, 'num');
     if ($result !== false) {
         if ($result === -11) {
             showDialog('非法提交');
         } elseif ($result === -12) {
             showDialog('驗證碼錯誤');
         }
     }
     if (empty($_POST['username'])) {
         showDialog($lang['login_password_input_username']);
     }
     if (process::islock('forget')) {
         showDialog($lang['nc_common_op_repeat'], 'reload');
     }
     $member_model = Model('member');
     $member = $member_model->getMemberInfo(array('member_name' => $_POST['username']));
     if (empty($member) or !is_array($member)) {
         process::addprocess('forget');
         showDialog($lang['login_password_username_not_exists'], 'reload');
     }
     if (empty($_POST['email'])) {
         showDialog($lang['login_password_input_email'], 'reload');
     }
     if (strtoupper($_POST['email']) != strtoupper($member['member_email'])) {
         process::addprocess('forget');
         showDialog($lang['login_password_email_not_exists'], 'reload');
     }
     process::clear('forget');
     //產生密碼
     $new_password = random(15);
     if (!$member_model->editMember(array('member_id' => $member['member_id']), array('member_passwd' => md5($new_password)))) {
         showDialog($lang['login_password_email_fail'], 'reload');
     }
     $model_tpl = Model('mail_templates');
     $tpl_info = $model_tpl->getTplInfo(array('code' => 'reset_pwd'));
     $param = array();
     $param['site_name'] = C('site_name');
     $param['user_name'] = $_POST['username'];
     $param['new_password'] = $new_password;
     $param['site_url'] = SHOP_SITE_URL;
     $subject = ncReplaceText($tpl_info['title'], $param);
     $message = ncReplaceText($tpl_info['content'], $param);
     $email = new Email();
     $result = $email->send_sys_email($_POST["email"], $subject, $message);
     showDialog('新密碼已經發送至您的郵箱,請盡快登錄並更改密碼!', '', 'succ', '', 5);
 }
開發者ID:lehman3087,項目名稱:wanhaoshop,代碼行數:53,代碼來源:login.php


注:本文中的Email::send_sys_email方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。