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


PHP mail::assign方法代碼示例

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


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

示例1: OcHTMLPurifier

         $purifier = new OcHTMLPurifier($opt);
         $newstext = $purifier->purify($newstext);
     }
     $sTopic = sql_value("SELECT `name` FROM `news_topics` WHERE `id`='&1'", '', $topicid);
     $tpl->assign('newstopic', $sTopic);
     $tpl->assign('newstext', $newstext);
     // in DB schreiben
     sql("INSERT INTO `news` (`content`, `topic`, `display`) VALUES ('&1', '&2', '&3')", $newstext, $topicid, 0);
     $rs = sql("SELECT `email` FROM `user` WHERE `admin`\\&'&1'='&1'", ADMIN_USER);
     while ($r = sql_fetch_assoc($rs)) {
         // send confirmation
         $mail = new mail();
         $mail->name = 'newstopic';
         $mail->to = $r['email'];
         $mail->subject = $translate->t('A newsentry was created on opencaching', '', basename(__FILE__), __LINE__);
         $mail->assign('email', $email);
         $mail->assign('newstopic', $sTopic);
         $mail->assign('newstext', $newstext);
         $mail->send();
     }
     sql_free_result($rs);
     // erfolg anzeigen
     $tpl->display();
     exit;
 }
 if ($emailok != true) {
     $tpl->assign('email_error', 1);
 }
 if ($captchaok != true) {
     $tpl->assign('captcha_error', 1);
 }
開發者ID:kirstenko,項目名稱:oc-server3,代碼行數:31,代碼來源:newstopic.php

示例2: sql_warn

function sql_warn($warnmessage)
{
    global $opt;
    if ($opt['db']['error']['mail'] != '') {
        if (admin_errormail($opt['db']['error']['mail'], $opt['db']['warn']['subject'], $warnmessage . "\n" . print_r(debug_backtrace(), true), "From: " . $opt['mail']['from'])) {
            require_once $opt['rootpath'] . 'lib2/mail.class.php';
            $mail = new mail();
            $mail->name = 'sql_warn';
            $mail->subject = $opt['db']['warn']['subject'];
            $mail->to = $opt['db']['warn']['mail'];
            $mail->assign('warnmessage', $warnmessage);
            $mail->assign('trace', print_r(debug_backtrace(), true));
            $mail->send();
            $mail = null;
        }
    }
}
開發者ID:kirstenko,項目名稱:oc-server3,代碼行數:17,代碼來源:db.inc.php

示例3: sendEMail

 function sendEMail($nFromUserId, $sSubject, $sText, $bSendEMailAddress)
 {
     global $opt, $translate;
     if ($this->exist() == false) {
         return false;
     }
     if ($this->getIsActive() == false) {
         return false;
     }
     if ($this->getEMail() === null || $this->getEMail() == '') {
         return false;
     }
     if ($sSubject == '') {
         return false;
     }
     if ($sText == '') {
         return false;
     }
     if (mb_strpos($sSubject, "\n") !== false) {
         $sSubject = mb_substr($sSubject, 0, mb_strpos($sSubject, "\n"));
     }
     $sSubject = mb_trim($sSubject);
     $fromUser = new user($nFromUserId);
     if ($fromUser->exist() == false) {
         return false;
     }
     if ($fromUser->getIsActive() == false) {
         return false;
     }
     if ($fromUser->getEMail() === null || $fromUser->getEMail() == '') {
         return false;
     }
     $language = $this->getLanguageCode();
     if (!$language) {
         $language = $opt['template']['locale'];
     }
     // ok, we can send ...
     $mail = new mail();
     $mail->name = 'usercontactmail';
     $mail->to = $this->getEMail();
     $mail->recipient_locale = $this->getLanguageCode();
     $mail->from = $opt['mail']['usermail'];
     if ($bSendEMailAddress == true) {
         $mail->replyTo = $fromUser->getEMail();
         $mail->returnPath = $fromUser->getEMail();
     }
     $mail->subject = $translate->t('E-Mail from', '', basename(__FILE__), __LINE__, '', 1, $language) . ' ' . $fromUser->getUsername() . ': ' . $sSubject;
     $mail->assign('usersubject', $sSubject);
     $mail->assign('text', $sText);
     $mail->assign('username', $this->getUsername());
     $mail->assign('sendemailaddress', $bSendEMailAddress);
     $mail->assign('fromusername', $fromUser->getUsername());
     $mail->assign('fromuserid', $fromUser->getUserId());
     $mail->assign('fromuseremail', $fromUser->getEMail());
     if ($mail->send()) {
         // send copy to fromUser
         $mail->assign('copy', true);
         $mail->to = $fromUser->getEMail();
         $mail->send();
         // log
         sql("INSERT INTO `email_user` (`ipaddress`, \n\t\t\t                               `from_user_id`, \n\t\t\t                               `from_email`, \n\t\t\t                               `to_user_id`, \n\t\t\t                               `to_email`)\n\t\t\t                       VALUES ('&1', '&2', '&3', '&4', '&5')", $_SERVER["REMOTE_ADDR"], $fromUser->getUserId(), $fromUser->getEMail(), $this->getUserId(), $this->getEMail());
         return true;
     } else {
         return false;
     }
 }
開發者ID:harrieklomp,項目名稱:oc-server3,代碼行數:66,代碼來源:user.class.php


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