• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getMailer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getMailer函数的典型用法代码示例。如果您正苦于以下问题:PHP getMailer函数的具体用法?PHP getMailer怎么用?PHP getMailer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getMailer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: send

 /**
  * Send newsletter via the Mlmmj mailing list
  *
  * @param string $email
  * @return bool
  */
 function send($email)
 {
     //send content to mailing list
     $mailer = getMailer();
     /* @var $mailer XoopsMailer */
     $mailer->useMail();
     $mailer->setBody($this->body);
     $mailer->setFromEmail($this->fromEmail);
     $mailer->setFromName($this->fromName);
     if (count($this->headers) > 0) {
         foreach ($this->headers as $header) {
             $mailer->addHeaders($header);
         }
     }
     $mailer->setSubject($this->subject);
     $mailer->multimailer->isHTML(true);
     //$this->addAttachments($mailer);
     //Send to specified email
     $mailer->setToEmails($email);
     if (!$mailer->send(true)) {
         echo $mailer->getErrors();
         return false;
     }
     return true;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:previewmailer.php


示例2: sendComment

function sendComment()
{
    global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $mc, $xoopsConfig;
    $util =& RMUtils::getInstance();
    if (!$util->validateToken()) {
        redirect_header('comment.php', 2, _MS_TC_ERRID);
        die;
    }
    foreach ($_POST as $k => $v) {
        ${$k} = $v;
    }
    if ($name == '' || $email == '' || $comment == '') {
        redirect_header('comment.php', 2, _MS_TC_ERRFIELDS);
        die;
    }
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $xoopsMailer->setTemplate('mail.tpl');
    $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
    $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
    $xoopsMailer->assign('SITEURL', XOOPS_URL . "/");
    $xoopsMailer->assign('NAME', $name);
    $xoopsMailer->assign('EMAIL', $email);
    $xoopsMailer->assign('COMMENTS', $comment);
    $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH . "/modules/team/language/" . $xoopsConfig['language'] . "/");
    $xoopsMailer->setFromEmail($email);
    $xoopsMailer->setFromName($name);
    $xoopsMailer->setSubject(sprintf(_MS_TC_COMFROM, $xoopsConfig['sitename'] . ": " . $xoopsModule->name()));
    $xoopsMailer->setToEmails($xoopsModuleConfig['email']);
    if (!$xoopsMailer->send(true)) {
        redirect_header('comment.php', 2, $xoopsMailer->getErrors());
    } else {
        redirect_header('./', 1, _MS_TC_COMTHX);
    }
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:35,代码来源:comment.php


示例3: send

 /**
  * Send newsletter via the SmartMail Mail Sender Service Interface
  *
  * @param array $recipients
  * @return bool
  */
 function send($recipients)
 {
     $output = $this->getXML($recipients);
     // Debug data - will be removed
     $filename = XOOPS_UPLOAD_PATH . "/mailtest.xml";
     $fp = fopen($filename, "w");
     fwrite($fp, $output);
     //send content to mailing list
     $mailer = getMailer();
     /* @var $mailer XoopsMailer */
     $mailer->useMail();
     $mailer->setBody($output);
     $mailer->setFromEmail($this->fromEmail);
     $mailer->setFromName($this->fromName);
     if (count($this->headers) > 0) {
         foreach ($this->headers as $header) {
             $mailer->addHeaders($header);
         }
     }
     $mailer->setSubject($this->subject);
     $mailer->multimailer->isHTML(true);
     //Send to specified email
     $mailer->setToEmails($this->email);
     if (!$mailer->send(true)) {
         echo $mailer->getErrors();
         return false;
     }
     return true;
 }
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:35,代码来源:smartmailer.php


示例4: testServices

 public function testServices()
 {
     $ins = getAuth();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Auth\IAuth::class, $ins);
     $ins = getView();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\View\IView::class, $ins);
     $ins = getLog();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Log\ILog::class, $ins);
     //        $ins = getDB();
     //        $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Database\MedooDB::class, $ins);
     //        $ins = getRedis();
     //        $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Database\PRedis::class, $ins);
     //        $ins = getDataPool();
     //        $this->assertInstanceOf(\Wwtg99\DataPool\Common\IDataPool::class, $ins);
     $ins = getCache();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\Cache::class, $ins);
     $ins = getSession();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\SessionUtil::class, $ins);
     $ins = getCookie();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\CookieUtil::class, $ins);
     $ins = getOValue();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Storage\OldValue::class, $ins);
     $ins = getAssets();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\View\AssetsManager::class, $ins);
     $ins = getMailer();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Utils\Mail::class, $ins);
     $ins = Flight::Express();
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Utils\Express::class, $ins);
     $ins = getPlugin('php');
     $this->assertInstanceOf(\Wwtg99\Flight2wwu\Component\Plugin\IPlugin::class, $ins);
 }
开发者ID:wwtg99,项目名称:flight2wwu,代码行数:31,代码来源:ComponentTester.php


示例5: ccenter_com_approve

function ccenter_com_approve(&$comment)
{
    global $xoopsDB, $xoopsUser, $xoopsModule, $xoopsConfig;
    $msgid = $comment->getVar('com_itemid');
    $res = $xoopsDB->query("SELECT uid, touid, email, onepass, fidref, title, status FROM " . CCMES . ", " . FORMS . " WHERE msgid={$msgid} AND formid=fidref");
    $comid = $comment->getVar('com_id');
    if ($res && $xoopsDB->getRowsNum($res)) {
        $data = $xoopsDB->fetchArray($res);
        $email = $data['email'];
        $s = $data['status'];
        $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
        $msg = _CC_LOG_COMMENT;
        $status = '';
        // new status
        $now = time();
        $values = array('mtime=' . $now);
        if ($uid && $uid == $data['touid']) {
            // comment by charge
            // status to replyed
            if ($s == _STATUS_ACCEPT) {
                $status = _STATUS_REPLY;
            }
            $msg .= _CC_LOG_BYCHARGE;
        } elseif ($uid == 0 || $uid == $data['uid']) {
            // comment by order person
            // status back to contacting
            if ($s == _STATUS_REPLY || $s == _STATUS_CLOSE) {
                $status = _STATUS_ACCEPT;
            }
            $values[] = 'atime=' . $now;
        }
        if ($status && $status != $s) {
            global $msg_status;
            $msg .= "\n" . sprintf(_CC_LOG_STATUS, $msg_status[$s], $msg_status[$status]);
            $values[] = 'status=' . $xoopsDB->quoteString($status);
        }
        $xoopsDB->query("UPDATE " . CCMES . " SET " . join(',', $values) . " WHERE msgid={$msgid}");
        cc_log_message($data['fidref'], $msg . " (comid={$comid})", $msgid);
        // notification for guest contact
        if (is_object($xoopsUser) && $data['uid'] == 0 && $email) {
            $subj = $data['title'];
            $url = XOOPS_URL . "/modules/" . basename(dirname(__FILE__)) . "/message.php?id={$msgid}&p=" . urlencode($data['onepass']) . "#comment{$comid}";
            $tags = array('X_MODULE' => $xoopsModule->getVar('name'), 'X_ITEM_TYPE' => '', 'X_ITEM_NAME' => $subj, 'X_COMMENT_URL' => $url, 'FROM_EMAIL' => $email, 'SUBJECT' => $subj);
            $xoopsMailer =& getMailer();
            $xoopsMailer->useMail();
            $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            $xoopsMailer->setFromName($xoopsModule->getVar('name'));
            $xoopsMailer->setSubject(_MD_NOTIFY_SUBJ);
            $xoopsMailer->assign($tags);
            $tpl = 'guest_notify.tpl';
            $xoopsMailer->setTemplateDir(template_dir($tpl));
            $xoopsMailer->setTemplate($tpl);
            $xoopsMailer->setToEmails($email);
            $xoopsMailer->send();
        }
    }
}
开发者ID:nbuy,项目名称:xoops-modules-ccenter,代码行数:57,代码来源:comment_functions.php


示例6: addEmail

function addEmail($email)
{
    if ($email != "") {
        // Add Mailerspecific link
        $result = "<a href=" . '"' . getMailer() . $email . '"' . ">" . $email . "</a>";
        // Add a link to the guess homepage
        $homepage = guessOneHomepage($email);
        if (!isset($_GET["print"]) && $homepage != "") {
            $result .= " (<a href=" . '"http://' . $homepage . '" target="_new"' . ">" . $homepage . "</a>)";
        }
        return add($result);
    } else {
        return "";
    }
}
开发者ID:karanikn,项目名称:php-addressbook,代码行数:15,代码来源:view.w.php


示例7: send_mail

function send_mail($s, $valid)
{
    global $tpl;
    $tpl->assign('user', $s);
    if (isset($_POST["send"])) {
        $mail = getMailer();
        $mail->AddAddress($s->user_email);
        $mail->Subject = '[intra LATEB] ' . $_POST['title'];
        $mail->Body = $tpl->fetch('mail_send.tpl');
        if ($mail->Send() == false) {
            $valid[] = $s->user_email;
        }
    }
    return $valid;
}
开发者ID:bontiv,项目名称:intrateb,代码行数:15,代码来源:ml.php


示例8: main

function main()
{
    global $session;
    global $db_connect_info;
    global $http_user_email;
    if ($session->started()) {
        navigateTo(HREF_MAIN);
    }
    $http_user_email = trim($_POST['user-email']);
    // 입력 값의 유효성을 검증한다.
    if (empty($http_user_email)) {
        return array('result' => true, 'message' => '');
    }
    // 이메일 포멧의 유효성을 검증한다.
    if (!filter_var($http_user_email, FILTER_VALIDATE_EMAIL)) {
        return array('result' => false, 'message' => '이메일 주소가 올바르지 않습니다');
    }
    // reCAPTCHA를 검증한다.
    if (!getReCaptcha()) {
        return array('result' => false, 'message' => 'reCAPTCHA가 올바르게 입력되지 않았습니다');
    }
    $db = new YwDatabase($db_connect_info);
    // 데이터베이스 연결을 체크한다.
    if (!$db->connect()) {
        return array('result' => false, 'message' => '서버와의 연결에 실패했습니다');
    }
    // 아이디와 이메일 유효성을 검증한다.
    if (!$db->query("SELECT `name` FROM " . USER_TABLE . " WHERE `email`='" . $db->purify($http_user_email) . "';")) {
        return array('result' => false, 'message' => '이메일 주소를 조회하는데 실패했습니다');
    }
    if ($db->total_results() < 1) {
        return array('result' => false, 'message' => '존재하지 않는 이메일 주소입니다');
    }
    $result = $db->get_result();
    $user_name = $result['name'];
    // 새로운 비밀번호를 생성한다.
    $generated_password = bin2hex(openssl_random_pseudo_bytes(6));
    if (!$db->query("UPDATE " . USER_TABLE . " SET `password`='" . passwordHash($generated_password) . "' WHERE `email`='" . $db->purify($http_user_email) . "';")) {
        return array('result' => false, 'message' => '비밀번호를 업데이트하는데 실패했습니다');
    }
    $email_content = "<b>" . $user_name . "</b> 회원님의 새 비밀번호는 <b>" . $generated_password . "</b>입니다.";
    if (!getMailer($http_user_email, "연세위키 비밀번호를 알려드립니다", $email_content)) {
        return array('result' => false, 'message' => '이메일 발송에 실패했습니다');
    }
    $db->log($user_name, LOG_RESET, '1');
    $db->close();
    return array('result' => true, 'message' => '이메일로 아이디와 새로운 비밀번호를 전송했습니다');
}
开发者ID:agemor,项目名称:yaong-wiki,代码行数:48,代码来源:page.reset.php


示例9: send_message

function send_message()
{
    global $xoopsModule, $xoopsModuleConfig, $xoopsUser;
    $name = rmc_server_var($_POST, 'name', '');
    $email = rmc_server_var($_POST, 'email', '');
    $company = rmc_server_var($_POST, 'company', '');
    $phone = rmc_server_var($_POST, 'phone', '');
    $subject = rmc_server_var($_POST, 'subject', '');
    $message = rmc_server_var($_POST, 'message', '');
    if ($name == '' || $email == '' || !checkEmail($email) || $subject == '' || $message == '') {
        redirect_header($xoopsModuleConfig['url'], 1, __('Please fill all required fileds before to send this message!', 'contact'));
        die;
    }
    // Recaptcha check
    if (!RMEvents::get()->run_event('rmcommon.captcha.check', true)) {
        redirect_header($xoopsModuleConfig['url'], 1, __('Please check the security words and write it correctly!', 'contact'));
        die;
    }
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $xoopsMailer->setBody($message . "\n--------------\n" . __('Message sent with ContactMe!', 'contact') . "\n" . $xoopsModuleConfig['url']);
    $xoopsMailer->setToEmails($xoopsModuleConfig['mail']);
    $xoopsMailer->setFromEmail($email);
    $xoopsMailer->setFromName($name);
    $xoopsMailer->setSubject($subject);
    if (!$xoopsMailer->send(true)) {
        redirect_header($xoopsModuleConfig['url'], 1, __('Message could not be delivered. Please try again.', 'contact'));
        die;
    }
    // Save message on database for further use
    $msg = new CTMessage();
    $msg->setVar('subject', $subject);
    $msg->setVar('ip', $_SERVER['REMOTE_ADDR']);
    $msg->setVar('email', $email);
    $msg->setVar('name', $name);
    $msg->setVar('org', $company);
    $msg->setVar('body', $message);
    $msg->setVar('phone', $phone);
    $msg->setVar('register', $xoopsUser ? 1 : 0);
    if ($xoopsUser) {
        $msg->setVar('xuid', $xoopsUser->uid());
    }
    $msg->setVar('date', time());
    $msg->save();
    redirect_header(XOOPS_URL, 1, __('Your message has been sent successfully!', 'contact'));
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:46,代码来源:index.php


示例10: execute

 function execute(&$controller, &$xoopsUser)
 {
     $this->mActionForm->fetch();
     $this->mActionForm->validate();
     if ($this->mActionForm->hasError()) {
         return LEGACY_FRAME_VIEW_INPUT;
     }
     $root =& XCube_Root::getSingleton();
     $this->mMailer =& getMailer();
     $this->mMailer->setTemplate("tellfriend.tpl");
     $this->mMailer->assign("SITENAME", $root->mContext->getXoopsConfig('sitename'));
     $this->mMailer->assign("ADMINMAIL", $root->mContext->getXoopsConfig('adminmail'));
     $this->mMailer->assign("SITEURL", XOOPS_URL . '/');
     $this->mActionForm->update($this->mMailer);
     $root->mLanguageManager->loadPageTypeMessageCatalog("misc");
     $this->mMailer->setSubject(sprintf(_MSC_INTSITE, $root->mContext->getXoopsConfig('sitename')));
     return $this->mMailer->send() ? LEGACY_FRAME_VIEW_SUCCESS : LEGACY_FRAME_VIEW_ERROR;
 }
开发者ID:nouphet,项目名称:rata,代码行数:18,代码来源:MiscFriendAction.class.php


示例11: tellafriend_sendMail

function tellafriend_sendMail($tMail, $bSenMail = true, $numError = 0)
{
    global $xoopsDB, $xoopsModuleConfig;
    $formatDate = 'Y-m-d H:i:s';
    $tMail['new_date'] = date($formatDate);
    //---------------------------------------------------
    if ($bSenMail) {
        $xoopsMailer =& getMailer();
        $xoopsMailer->useMail();
        $xoopsMailer->setToEmails($tMail['users_to']);
        $xoopsMailer->setFromEmail($tMail['users_email']);
        $xoopsMailer->setFromName($tMail['users_name']);
        $xoopsMailer->setSubject($tMail['users_subject']);
        $xoopsMailer->setBody($tMail['message_body']);
        $send_result = $xoopsMailer->send();
        if ($send_result) {
            $tMail['result'] = _MI_TAF_MESSAGESENT;
        } else {
            $tMail['result'] = _MI_TAF_SENDERROR;
        }
    } else {
        switch ($numError) {
            case 1:
                $tMail['result'] = _MI_TAF_INVALIDMAILFROM;
                break;
            case 2:
                $tMail['result'] = _MI_TAF_INVALIDMAILTO;
                break;
            case 3:
                $tMail['result'] = _MI_TAF_TOOMANY;
                break;
            default:
                break;
        }
    }
    //---------------------------------------------------
    if ($send_result || $xoopsModuleConfig['log_send_in_echec']) {
        $xoopsDB->query("INSERT INTO " . $xoopsDB->prefix("tellafriend_log") . " SET " . "uid='{$tMail['uid']}'," . "ip='{$tMail['REMOTE_ADDR']}'," . "mail_fromname='" . addslashes($tMail['users_name']) . "'," . "mail_fromemail='" . addslashes($tMail['users_email']) . "'," . "mail_to='" . addslashes($tMail['users_to']) . "'," . "mail_subject='" . addslashes($tMail['users_subject']) . "'," . "mail_body='" . addslashes($tMail['message_body']) . "'," . "agent='" . addslashes($tMail['HTTP_USER_AGENT']) . "'," . "result='" . addslashes($tMail['result']) . "'," . "date_send='{$tMail['new_date']}'");
    }
    //---------------------------------------------------
    return $tMail['result'];
}
开发者ID:jjdai,项目名称:tellafriend,代码行数:42,代码来源:functions.php


示例12: user_notify

function user_notify($eid)
{
    global $xoopsDB, $xoopsConfig;
    $result = $xoopsDB->query("SELECT title,edate,expire,status,topicid FROM " . EGTBL . " WHERE eid={$eid}");
    if (!$result || $xoopsDB->getRowsNum($result) == 0) {
        echo "<div class='error'>Not found Event(eid='{$eid}')</div>\n";
        return;
    }
    $data = $xoopsDB->fetchArray($result);
    $title = $data['title'];
    $edate = $data['edate'];
    $expire = $data['expire'];
    // using XOOPS2 notification system
    if (!$GLOBALS['xoopsModuleConfig']['user_notify'] || ($expire > $edate ? $expire < time() : $edate + $expire < time()) || $data['status'] != STAT_NORMAL) {
        return false;
    }
    $tags = array('EVENT_TITLE' => $title, 'EVENT_DATE' => eventdate($edate, _MD_TIME_FMT), 'EVENT_NOTE' => '', 'EVENT_URL' => EGUIDE_URL . "/event.php?eid={$eid}");
    $notification_handler =& xoops_gethandler('notification');
    $notification_handler->triggerEvent('global', 0, 'new', $tags);
    $notification_handler->triggerEvent('category', $data['topicid'], 'new', $tags);
    $result = $xoopsDB->query("SELECT rvid, email, confirm FROM " . RVTBL . " WHERE eid=0");
    while ($data = $xoopsDB->fetchArray($result)) {
        $xoopsMailer =& getMailer();
        $xoopsMailer->useMail();
        $xoopsMailer->setSubject(_MD_NEWSUB);
        $tpl = 'notify_user_new.tpl';
        $xoopsMailer->setTemplateDir(template_dir($tpl));
        $xoopsMailer->setTemplate($tpl);
        $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
        $xoopsMailer->setFromName(eguide_from_name());
        $xoopsMailer->assign($tags);
        $xoopsMailer->assign("CANCEL_URL", EGUIDE_URL . "/reserv.php?op=cancel&rvid=" . $data['rvid'] . "&key=" . $data['confirm']);
        $xoopsMailer->setToEmails($data['email']);
        if (!$xoopsMailer->send()) {
            echo "<div class='error'>" . $xoopsMailer->getErrors() . "</div>\n";
        }
    }
}
开发者ID:nbuy,项目名称:xoops-modules-eguide,代码行数:38,代码来源:notify.inc.php


示例13: notifyUser

 /**
  * Send a notification message to the user
  *
  * @param  string  $template_dir  Template directory
  * @param  string  $template      Template name
  * @param  string  $subject       Subject line for notification message
  * @param  array   $tags Array of substitutions for template variables
  *
  * @return  bool	true if success, false if error
  **/
 function notifyUser($template_dir, $template, $subject, $tags)
 {
     // Check the user's notification preference.
     $member_handler = xoops_gethandler('member');
     $user =& $member_handler->getUser($this->getVar('not_uid'));
     if (!is_object($user)) {
         return true;
     }
     $method = $user->getVar('notify_method');
     $xoopsMailer =& getMailer();
     include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
     switch ($method) {
         case XOOPS_NOTIFICATION_METHOD_PM:
             $xoopsMailer->usePM();
             $config_handler = xoops_gethandler('config');
             $xoopsMailerConfig =& $config_handler->getConfigsByCat(XOOPS_CONF_MAILER);
             $xoopsMailer->setFromUser($member_handler->getUser($xoopsMailerConfig['fromuid']));
             foreach ($tags as $k => $v) {
                 $xoopsMailer->assign($k, $v);
             }
             break;
         case XOOPS_NOTIFICATION_METHOD_EMAIL:
             $xoopsMailer->useMail();
             foreach ($tags as $k => $v) {
                 $xoopsMailer->assign($k, preg_replace("/&amp;/i", '&', $v));
             }
             break;
         default:
             return true;
             // report error in user's profile??
             break;
     }
     // Set up the mailer
     $xoopsMailer->setTemplateDir($template_dir);
     $xoopsMailer->setTemplate($template);
     $xoopsMailer->setToUsers($user);
     //global $xoopsConfig;
     //$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
     //$xoopsMailer->setFromName($xoopsConfig['sitename']);
     $xoopsMailer->setSubject($subject);
     $success = $xoopsMailer->send();
     // If send-once-then-delete, delete notification
     // If send-once-then-wait, disable notification
     include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
     $notification_handler = xoops_gethandler('notification');
     if ($this->getVar('not_mode') == XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE) {
         $notification_handler->delete($this);
         return $success;
     }
     if ($this->getVar('not_mode') == XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT) {
         $this->setVar('not_mode', XOOPS_NOTIFICATION_MODE_WAITFORLOGIN);
         $notification_handler->insert($this);
     }
     return $success;
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:65,代码来源:notification.php


示例14: sendMail

 function sendMail()
 {
     $mail_body = $this->makeMailBody();
     $cc_mail_body = $this->makeCCMailBody();
     $subject = $this->makeMailSubject();
     $cc_subject = $this->makeCCMailSubject();
     // easiestml
     if (function_exists('easiestml')) {
         $mail_body = easiestml($mail_body);
         $cc_mail_body = easiestml($cc_mail_body);
         $subject = easiestml($subject);
         $cc_subject = easiestml($cc_subject);
     }
     // send main mail (server to admin/poster)
     if (!empty($this->toEmails)) {
         // initialize
         $toMailer =& getMailer();
         $toMailer->useMail();
         $toMailer->setFromEmail($this->fromEmail);
         $toMailer->setFromName($this->fromName);
         // "from" overridden by form data
         if (!empty($this->from_field_name) && $this->isValidEmail($this->form_processor->fields[$this->from_field_name]['value'])) {
             $toMailer->setFromEmail($this->form_processor->fields[$this->from_field_name]['value']);
             if (!empty($this->fromname_field_name) && !empty($this->form_processor->fields[$this->fromname_field_name]['value'])) {
                 // remove cr, lf, null
                 $toMailer->setFromName(str_replace(array("\n", "\r", ""), '', $this->form_processor->fields[$this->fromname_field_name]['value']));
             }
         }
         // "Reply-To" header
         if (!empty($this->replyto_field_name) && $this->isValidEmail($this->form_processor->fields[$this->replyto_field_name]['value'])) {
             $toMailer->addHeaders('Reply-To: ' . $this->form_processor->fields[$this->replyto_field_name]['value']);
         }
         $toMailer->setToEmails(array_unique($this->toEmails));
         $toMailer->setSubject($subject);
         $toMailer->setBody($mail_body);
         $toMailer->send();
     }
     // send confirming mail (server to visitor)
     if (!empty($this->cc_field_name) && !empty($this->form_processor->fields[$this->cc_field_name]['value'])) {
         // initialize
         $ccMailer =& getMailer();
         $ccMailer->useMail();
         $ccMailer->setFromEmail($this->fromEmail);
         $ccMailer->setFromName($this->fromName);
         $ccMailer->setToEmails($this->form_processor->fields[$this->cc_field_name]['value']);
         $ccMailer->setSubject($cc_subject);
         $ccMailer->setBody($cc_mail_body);
         $ccMailer->send();
     }
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:50,代码来源:PicoFormProcessBySmartyBase.class.php


示例15: order_notify

function order_notify($data, $email, $value)
{
    global $xoopsModuleConfig, $xoopsUser, $xoopsModule;
    $poster = new XoopsUser($data['uid']);
    $eid = $data['eid'];
    $exid = $data['exid'];
    $url = EGUIDE_URL . '/event.php?eid=' . $eid . ($exid ? "&sub={$exid}" : '');
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $tplname = $data['autoaccept'] ? "accept%s.tpl" : "order%s.tpl";
    $extra = eguide_form_options('reply_extension');
    $tplfile = sprintf($tplname, '');
    // default template name
    $tmpdir = template_dir($tplfile);
    if ($extra) {
        $vals = unserialize_text($value);
        if (isset($vals[$extra])) {
            $extpl = sprintf($tplname, $vals[$extra]);
            if (file_exists("{$tmpdir}{$extpl}")) {
                $tplfile = $extpl;
            }
        }
    } else {
        $extra = eguide_form_options('reply_tpl_suffix');
        if ($extra) {
            $extpl = sprintf($tplname, $extra);
            if (file_exists("{$tmpdir}{$extpl}")) {
                $tplfile = $extpl;
            }
        }
    }
    $xoopsMailer->setTemplateDir($tmpdir);
    $xoopsMailer->setTemplate($tplfile);
    if ($xoopsModuleConfig['member_only'] && is_object($xoopsUser)) {
        $user = $xoopsUser;
        if (isset($data['reserv_uid'])) {
            $ruid = $data['reserv_uid'];
            $user = new XoopsUser($ruid);
        } else {
            $xoopsMailer->setToUsers($user);
        }
        $uinfo = sprintf("%s: %s (%s)\n", _MD_UNAME, $user->getVar('uname'), $user->getVar('name'));
    } else {
        if (!empty($email)) {
            $xoopsMailer->setToEmails($email);
        }
        $uinfo = "";
    }
    if ($email) {
        $uinfo .= sprintf("%s: %s\n", _MD_EMAIL, $email);
    }
    $rvid = $data['rvid'];
    $conf = $data['confirm'];
    $edate = eventdate($data['edate']);
    $tags = array("EVENT_URL" => $url, "RVID" => $rvid, "CANCEL_KEY" => $conf, "CANCEL_URL" => EGUIDE_URL . "/reserv.php?op=cancel&rvid={$rvid}&key={$conf}", "INFO" => $uinfo . $value, "TITLE" => $edate . " " . $data['title'], "EVENT_DATE" => $edate, "EVENT_TITLE" => $data['title'], "SUMMARY" => strip_tags($data['summary']));
    $subj = eguide_form_options('reply_subject', _MD_SUBJECT);
    $xoopsMailer->assign($tags);
    $xoopsMailer->setSubject($subj);
    $xoopsMailer->setFromEmail($poster->getVar('email'));
    $xoopsMailer->setFromName(eguide_from_name());
    $ret = $xoopsMailer->send();
    // send to order person
    if (!$ret) {
        return $ret;
    }
    $xoopsMailer->reset();
    $xoopsMailer->useMail();
    $xoopsMailer->setTemplateDir(template_dir($tplfile));
    $xoopsMailer->setTemplate($tplfile);
    $xoopsMailer->assign($tags);
    $xoopsMailer->setSubject($subj);
    $xoopsMailer->setFromEmail($poster->getVar('email'));
    $xoopsMailer->setFromName(eguide_from_name());
    if ($data['notify']) {
        if (!in_array($xoopsModuleConfig['notify_group'], $poster->groups())) {
            $xoopsMailer->setToUsers($poster);
        }
        $member_handler =& xoops_gethandler('member');
        $notify_group = $member_handler->getGroup($xoopsModuleConfig['notify_group']);
        $xoopsMailer->setToGroups($notify_group);
        $xoopsMailer->send();
    }
    return $ret;
}
开发者ID:nbuy,项目名称:xoops-modules-eguide,代码行数:84,代码来源:functions.php


示例16: str_replace

         $sql = "SELECT email, userid FROM users WHERE userid = (SELECT userid FROM experiments WHERE id = :id)";
         $req = $pdo->prepare($sql);
         $req->bindParam(':id', $id);
         $req->execute();
         $users = $req->fetch();
         // don't send an email if we are commenting on our own XP
         if ($users['userid'] === $_SESSION['userid']) {
             exit;
         }
         // Create the message
         $url = 'https://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['PHP_SELF'];
         $url = str_replace('app/editinplace.php', 'experiments.php', $url);
         $full_url = $url . "?mode=view&id=" . $id;
         $footer = "\n\n~~~\nSent from eLabFTW http://www.elabftw.net\n";
         $message = Swift_Message::newInstance()->setSubject(_('[eLabFTW] New comment posted'))->setFrom(array(get_config('mail_from') => 'eLabFTW'))->setTo(array($users['email'] => 'Admin eLabFTW'))->setBody(sprintf(_('Hi. %s %s left a comment on your experiment. Have a look: %s'), $commenter['firstname'], $commenter['lastname'], $full_url) . $footer);
         $mailer = getMailer();
         // SEND EMAIL
         try {
             $mailer->send($message);
         } catch (Exception $e) {
             dblog('Error', 'smtp', $e->getMessage());
             exit;
         }
     }
 } else {
     // UPDATE OF EXISTING COMMENT
     if ($id_arr[0] === 'expcomment' && is_pos_int($id_arr[1])) {
         $id = $id_arr[1];
         // Update comment
         if ($_POST['expcomment'] != '' && $_POST['expcomment'] != ' ') {
             // we must first check
开发者ID:jcapellman,项目名称:elabftw,代码行数:31,代码来源:editinplace.php


示例17: index_password

function index_password()
{
    global $tpl, $config;
    $cfg = $config['recaptcha'];
    $tpl->assign('siteKey', $cfg['siteKey']);
    if (isset($_POST['valider'])) {
        if (isset($_POST['g-recaptcha-response'])) {
            $captcha = $_POST['g-recaptcha-response'];
        }
        $cfg = $config['recaptcha'];
        $secretKey = $cfg['secretKey'];
        if ($secretKey) {
            if (!$captcha) {
                $tpl->assign('msg', 'Erreur de captcha, veuillez resaisir les informations.');
                $tpl->assign('error_captcha', true);
                display();
                return;
            }
            $ip = $_SERVER['REMOTE_ADDR'];
            $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=" . $secretKey . "&response=" . $captcha . "&remoteip=" . $ip);
            $responseKeys = json_decode($response, true);
            if (intval($responseKeys["success"]) !== 1) {
                $tpl->assign('msg', 'Erreur de captcha, veuillez resaisir les informations.');
                $tpl->assign('error_captcha', true);
                display();
                return;
            }
        }
        // Recherche du membre
        $mdl = new Modele('users');
        $mdl->find(array('user_email' => $_POST['mail']));
        if (!$mdl->next()) {
            $tpl->assign('msg', 'L\'adresse email est introuvable');
            $tpl->assign('error_mail', true);
            // Membre existe
        } else {
            $_SESSION['index_password_code'] = uniqid();
            $_SESSION['index_password_email'] = $_POST['mail'];
            $schema = isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME'] : 'http';
            $tpl->assign('url', $schema . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . mkurl('index', 'password_change', array(session_name() => session_id(), 'valid' => $_SESSION['index_password_code'])));
            $mail = getMailer();
            $mail->AddAddress($_SESSION['index_password_email']);
            $mail->Subject = '[intra LATEB] mot de passe perdu';
            $mail->Body = $tpl->fetch('mail_password.tpl');
            $tpl->assign('msuccess', $mail->Send());
        }
    }
    display();
}
开发者ID:bontiv,项目名称:intrateb,代码行数:49,代码来源:index.php


示例18: sendMail

 function sendMail($spamlev)
 {
     global $xoopsUser;
     $info = array();
     $info['TIME'] = date('r', time());
     if (is_object($xoopsUser)) {
         $info['UID'] = (int) $xoopsUser->uid();
         $info['UNAME'] = $xoopsUser->uname();
     } else {
         $info['UID'] = 0;
         $info['UNAME'] = 'Guest';
     }
     $info['REQUEST_URI'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
     $info['HTTP_REFERER'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
     $info['HTTP_USER_AGENT'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
     $info['REMOTE_ADDR'] = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
     $info['SPAM LEVEL'] = $spamlev;
     $_info = '';
     foreach ($info as $key => $value) {
         $_info .= $key . ': ' . $value . "\n";
     }
     $_info .= str_repeat('-', 30) . "\n";
     $post = $_POST;
     // Key:excerpt があればトラックかも->文字コード変換
     if (isset($post['excerpt']) && function_exists('mb_convert_variables')) {
         if (isset($post['charset']) && $post['charset'] != '') {
             // TrackBack Ping で指定されていることがある
             // うまくいかない場合は自動検出に切り替え
             if (mb_convert_variables($this->encode, $post['charset'], $post) !== $post['charset']) {
                 mb_convert_variables($this->encode, 'auto', $post);
             }
         } else {
             if (!empty($post)) {
                 // 全部まとめて、自動検出/変換
                 mb_convert_variables($this->encode, 'auto', $post);
             }
         }
     }
     $message = $_info . '$_POST :' . "\n" . print_r($post, TRUE);
     $message .= "\n" . str_repeat('=', 30) . "\n\n";
     if ($this->send_mail_interval) {
         $mail_tmp = XOOPS_TRUST_PATH . '/uploads/hyp_common/' . str_replace('/', '_', preg_replace('#https?://#i', '', XOOPS_URL)) . '.SPAM.hyp';
         if (!file_exists($mail_tmp)) {
             HypCommonFunc::flock_put_contents($mail_tmp, $message);
             return;
         } else {
             $mtime = filemtime($mail_tmp);
             if ($mtime + $this->send_mail_interval * 60 > time()) {
                 if (HypCommonFunc::flock_put_contents($mail_tmp, $message, 'ab')) {
                     HypCommonFunc::touch($mail_tmp, $mtime);
                 }
                 return;
             } else {
                 $message = HypCommonFunc::flock_get_contents($mail_tmp) . $message;
                 unlink($mail_tmp);
             }
         }
     }
     $config_handler =& xoops_gethandler('config');
     $xoopsConfig =& $config_handler->getConfigsByCat(XOOPS_CONF);
     $subject = '[' . $xoopsConfig['sitename'] . '] POST Spam Report';
     $xoopsMailer =& getMailer();
     $xoopsMailer->useMail();
     $xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
     $xoopsMailer->setFromName($xoopsConfig['sitename']);
     $xoopsMailer->setSubject($subject);
     $xoopsMailer->setBody($message);
     $xoopsMailer->setToEmails($xoopsConfig['adminmail']);
     $xoopsMailer->send();
     $xoopsMailer->reset();
 }
开发者ID:nao-pon,项目名称:HypCommon,代码行数:71,代码来源:hyp_preload.php


示例19: sendPostcard

/**
* @desc Envia la postal
*/
function sendPostcard()
{
    global $tpl, $xoopsModule, $xoopsModuleConfig, $rmc_config, $mc, $xoopsUser, $xoopsConfig, $util;
    foreach ($_POST as $k => $v) {
        ${$k} = $v;
    }
    if (!$xoopsUser) {
        redirect_header(XOOPS_URL . '/user.php#register', 1, _MS_GS_ERRUSR);
        die;
    }
    $img = new GSImage($img);
    if ($img->isNew()) {
        redirect_header(XOOPS_URL . '/modules/galleries/', 1, _MS_GS_ERRIMG);
        die;
    }
    // Recaptcha check
    if (!RMEvents::get()->run_event('rmcommon.captcha.check', true)) {
        redirect_header(GSFunctions::get_url() . ($xoopsModuleConfig['urlmode'] ? 'postcard/new/img/' . $img->id() . '/' : '?postcard=new&amp;img=' . $img->id()), 1, __('Please check the security words and write it correctly!', 'contact'));
        die;
    }
    $post = new GSPostcard();
    $post->setTitle($title);
    $post->setMessage($msg);
    $post->setDate(time());
    $post->setToName($tname);
    $post->setToEmail($tmail);
    $post->setImage($img->id());
    $post->setName($fname);
    $post->setEmail($fmail);
    $post->setUid($uid);
    $post->setIp($_SERVER['REMOTE_ADDR']);
    $post->setViewed(0);
    //Generamos el código de la postal
    $post->setCode(RMUtilities::randomString(10, 1, false, 1, 1));
    if (!$post->save()) {
        redirect_header(base64_decode($return), 2, __('Unable to send e-card. Please try again!', 'galleries'));
        die;
    }
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $ectpl = is_file(XOOPS_ROOT_PATH . '/modules/galleries/lang/' . 'postcard-' . $rmc_config['language'] . '.tpl') ? $rmc_config['language'] . '.tpl' : 'postcard-en_US.tpl';
    $xoopsMailer->setTemplate($ectpl);
    $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
    $xoopsMailer->assign('SITEURL', XOOPS_URL . "/");
    $xoopsMailer->assign('FNAME', $fname);
    $xoopsMailer->assign('FMAIL', $fmail);
    $xoopsMailer->assign('TNAME', $tname);
    $xoopsMailer->assign('MODULE_LINK', GSfunctions::get_url());
    $xoopsMailer->assign('POSTAL_LINK', GSfunctions::get_url() . ($mc['urlmode'] ? 'postcar 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getMaxUpload函数代码示例发布时间:2022-05-15
下一篇:
PHP getMPDCRONSettings函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap