当前位置: 首页>>代码示例>>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;未经允许,请勿转载。