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


PHP Kit::SendEmail方法代碼示例

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


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

示例1: AlertDisplayUp

 /**
  * Alert when a Display is up
  * @param int $displayId
  * @param string $display
  * @param int $loggedIn
  * @param int $emailAlert
  */
 private function AlertDisplayUp($displayId, $display, $loggedIn, $emailAlert)
 {
     $maintenanceEnabled = Config::GetSetting('MAINTENANCE_ENABLED');
     if ($loggedIn == 0) {
         // Log display up
         $statObject = new Stat();
         $statObject->displayUp($displayId);
         // Do we need to email?
         if ($emailAlert == 1 && ($maintenanceEnabled == 'On' || $maintenanceEnabled == 'Protected') && Config::GetSetting('MAINTENANCE_EMAIL_ALERTS') == 'On') {
             $msgTo = Kit::ValidateParam(Config::GetSetting("mail_to"), _PASSWORD);
             $msgFrom = Kit::ValidateParam(Config::GetSetting("mail_from"), _PASSWORD);
             $subject = sprintf(__("Recovery for Display %s"), $display);
             $body = sprintf(__("Display %s with ID %d is now back online."), $display, $displayId);
             // Get a list of people that have view access to the display?
             if (Config::GetSetting('MAINTENANCE_ALERTS_FOR_VIEW_USERS') == 1) {
                 foreach (Display::getUsers($displayId) as $user) {
                     if ($user['email'] != '') {
                         Kit::SendEmail($user['email'], $msgFrom, $subject, $body);
                     }
                 }
             }
             // Send to the original admin contact
             Kit::SendEmail($msgTo, $msgFrom, $subject, $body);
         }
     }
 }
開發者ID:rovak73,項目名稱:xibo-cms,代碼行數:33,代碼來源:xmdssoap4.class.php

示例2: sprintf

 // Should we send an email?
 if ($emailAlerts) {
     if (Kit::ValidateParam($display['email_alert'], _INT) == 1) {
         if ($displayGoneOffline || $alwaysAlert) {
             // Fields for email
             $subject = sprintf(__("Email Alert for Display %s"), Kit::ValidateParam($display['display'], _STRING));
             $body = sprintf(__("Display %s with ID %d was last seen at %s."), Kit::ValidateParam($display['display'], _STRING), Kit::ValidateParam($display['displayid'], _INT), date("Y-m-d H:i:s", Kit::ValidateParam($display['lastaccessed'], _INT)));
             // Get a list of people that have view access to the display?
             if ($alertForViewUsers) {
                 foreach (Display::getUsers($display['displayid']) as $user) {
                     if ($user['email'] != '') {
                         Kit::SendEmail($user['email'], $msgFrom, $subject, $body);
                     }
                 }
             }
             if (Kit::SendEmail($msgTo, $msgFrom, $subject, $body)) {
                 // Successful Alert
                 print "A";
             } else {
                 // Error sending Alert
                 print "E";
             }
         }
     } else {
         // Alert disabled for this display
         print "D";
     }
 } else {
     // Email alerts disabled globally
     print "X";
 }
開發者ID:fignew,項目名稱:xibo-cms,代碼行數:31,代碼來源:maintenance.php

示例3: AuthDisplay

 /**
  * Authenticates the display
  * @param <type> $hardwareKey
  * @return <type>
  */
 private function AuthDisplay($hardwareKey)
 {
     $db =& $this->db;
     // check in the database for this hardwareKey
     $SQL = "SELECT licensed, inc_schedule, isAuditing, displayID, defaultlayoutid, loggedin, email_alert, display, version_instructions FROM display WHERE license = '{$hardwareKey}'";
     if (!($result = $db->query($SQL))) {
         trigger_error("License key query failed:" . $db->error());
         return false;
     }
     //Is it there?
     if ($db->num_rows($result) == 0) {
         return false;
     }
     //we have seen this display before, so check the licensed value
     $row = $db->get_row($result);
     if ($row[0] == 0) {
         return false;
     }
     // Pull the client IP address
     $clientAddress = Kit::GetParam('REMOTE_ADDR', $_SERVER, _STRING);
     // See if the client was offline and if appropriate send an alert
     // to say that it has come back online
     if ($row[5] == 0 && $row[6] == 1 && Config::GetSetting('MAINTENANCE_ENABLED') == 'On' && Config::GetSetting('MAINTENANCE_EMAIL_ALERTS') == 'On') {
         $msgTo = Kit::ValidateParam(Config::GetSetting("mail_to"), _PASSWORD);
         $msgFrom = Kit::ValidateParam(Config::GetSetting("mail_from"), _PASSWORD);
         $subject = sprintf(__("Recovery for Display %s"), $row[7]);
         $body = sprintf(__("Display %s with ID %d is now back online."), $row[7], $row[3]);
         Kit::SendEmail($msgTo, $msgFrom, $subject, $body);
     }
     // Last accessed date on the display
     $displayObject = new Display($db);
     $displayObject->Touch($hardwareKey, $clientAddress);
     // It is licensed?
     $this->licensed = true;
     $this->includeSchedule = $row[1];
     $this->isAuditing = $row[2];
     $this->displayId = $row[3];
     $this->defaultLayoutId = $row[4];
     $this->version_instructions = $row[8];
     return true;
 }
開發者ID:abbeet,項目名稱:server39,代碼行數:46,代碼來源:xmdssoap.class.php


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