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


PHP Misc::sendEmail方法代碼示例

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


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

示例1: sendInvite

 /**
  * Send a email for a invitation request.
  *
  * @param string $siteTitle Name of the admin's website.
  * @param string $siteEmail Email of the admin's website.
  * @param string $serverURL Address of the admin's website.
  * @param int    $userID    ID of the user sending the request.
  * @param string $emailTo   Email of the person to send the request.
  *
  * @return string
  */
 public function sendInvite($siteTitle, $siteEmail, $serverURL, $userID, $emailTo)
 {
     $sender = $this->getById($userID);
     $token = $this->hashSHA1(uniqid());
     $subject = $siteTitle . " Invitation";
     $url = $serverURL . "register?invitecode=" . $token;
     if (!is_null($sender['firstname']) || $sender['firstname'] != '') {
         $contents = $sender["firstname"] . " " . $sender["lastname"] . " has sent an invite to join " . $siteTitle . " to this email address.<br>To accept the invitation click <a href=\"{$url}\">this link</a>\n";
     } else {
         $contents = $sender["username"] . " has sent an invite to join " . $siteTitle . " to this email address.<br>To accept the invitation click <a href=\"{$url}\">this link</a>\n";
     }
     Misc::sendEmail($emailTo, $subject, $contents, $siteEmail);
     $this->addInvite($userID, $token);
     return $url;
 }
開發者ID:kaibosh,項目名稱:nZEDb,代碼行數:26,代碼來源:Users.php

示例2:

    case 'submit':
        if ($captcha->getError() === false) {
            $email = $_POST['email'];
            if ($email == '') {
                $page->smarty->assign('error', "Missing Email");
            } else {
                // Check users exists and send an email.
                $ret = $page->users->getByEmail($email);
                if (!$ret) {
                    $sent = "true";
                    break;
                } else {
                    // Generate a forgottenpassword guid, store it in the user table.
                    $guid = md5(uniqid());
                    $page->users->updatePassResetGuid($ret["id"], $guid);
                    // Send the email
                    Misc::sendEmail($ret["email"], $page->settings->getSetting('title') . " Forgotten Password Request", "Someone has requested a password reset for this email address.<br>To reset the password use <a href=\"" . $page->serverurl . "forgottenpassword?action=reset&guid={$guid}\">this link</a>\n", $page->settings->getSetting('email'));
                    $sent = "true";
                    break;
                }
            }
        }
        break;
}
$page->smarty->assign(['email' => $email, 'confirmed' => $confirmed, 'sent' => $sent]);
$page->title = "Forgotten Password";
$page->meta_title = "Forgotten Password";
$page->meta_keywords = "forgotten,password,signup,registration";
$page->meta_description = "Forgotten Password";
$page->content = $page->smarty->fetch('forgottenpassword.tpl');
$page->render();
開發者ID:kaibosh,項目名稱:nZEDb,代碼行數:31,代碼來源:forgottenpassword.php

示例3: Captcha

use nzedb\utility\Misc;
use nzedb\Captcha;
$captcha = new Captcha($page);
$msg = '';
if (isset($_POST["useremail"])) {
    if ($captcha->getError() === false) {
        // Send the contact info and report back to user.
        $email = $_POST["useremail"];
        $mailto = $page->settings->getSetting('email');
        $mailsubj = "Contact Form Submitted";
        $mailbody = "Values submitted from contact form:<br/>";
        //@TODO take this loop out, it's not safe.
        while (list($key, $val) = each($_POST)) {
            if ($key != 'submit') {
                $mailbody .= "{$key} : {$val}<br/>";
            }
        }
        if (!preg_match("/\n/i", $_POST["useremail"])) {
            Misc::sendEmail($mailto, $mailsubj, $mailbody, $email);
        }
        $msg = "<h2 style='text-align:center;'>Thank you for getting in touch with " . $page->settings->getSetting('title') . ".</h2>";
    }
}
$page->smarty->assign("msg", $msg);
$page->title = "Contact " . $page->settings->getSetting('title');
$page->meta_title = "Contact " . $page->settings->getSetting('title');
$page->meta_keywords = "contact us,contact,get in touch,email";
$page->meta_description = "Contact us at " . $page->settings->getSetting('title') . " and submit your feedback";
$page->content = $page->smarty->fetch('contact.tpl');
$page->render();
開發者ID:kaibosh,項目名稱:nZEDb,代碼行數:30,代碼來源:contact-us.php


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