示例#1
0
function kl_sendmail_put_reply_mail($commentId, $reply)
{
    global $userData;
    include EMLOG_ROOT . '/content/plugins/kl_sendmail/kl_sendmail_config.php';
    if (KL_IS_REPLY_MAIL == 'Y') {
        $DB = Database::getInstance();
        $blogname = Option::get('blogname');
        $Comment_Model = new Comment_Model();
        $commentArray = $Comment_Model->getOneComment($commentId);
        extract($commentArray);
        $subject = "您在【{$blogname}】发表的评论收到了回复";
        if (strpos($mail, '@139.com') === false) {
            $emBlog = new Log_Model();
            $logData = $emBlog->getOneLogForHome($gid);
            $log_title = $logData['log_title'];
            $content = "{$poster},您好:<br /><br />您之前在《{$log_title}》发表的的评论:<br />{$comment}<br /><br />{$userData['username']}给您的回复:<br />{$reply}<br /><br /><strong>您可以点击<a href=\"" . Url::log($gid) . "#{$cid}\" target=\"_blank\">查看该日志</a></strong><br /><br /><strong>感谢您对<a href=\"" . BLOG_URL . "\" target=\"_blank\">{$blogname}</a>的关注,欢迎<a href=\"" . BLOG_URL . "rss.php\">订阅本站</a></strong><br /><br />";
        } else {
            $content = $reply;
        }
        if ($mail != '') {
            kl_sendmail_do(KL_MAIL_SMTP, KL_MAIL_PORT, KL_MAIL_SENDEMAIL, KL_MAIL_PASSWORD, $mail, $subject, $content, $blogname);
        }
    } else {
        return;
    }
}
示例#2
0
<?php

/**
 * kl_sendmail_test_do.php
 * design by KLLER
 */
require_once '../../../init.php';
!(ISLOGIN === true && $value['author'] == UID || ROLE == 'admin') && exit('access deined!');
include_once 'kl_sendmail_config.php';
require_once EMLOG_ROOT . '/content/plugins/kl_sendmail/class/class.smtp.php';
require_once EMLOG_ROOT . '/content/plugins/kl_sendmail/class/class.phpmailer.php';
$blogname = Option::get('blogname');
$subject = $content = '这是一封测试邮件';
if (kl_sendmail_do(KL_MAIL_SMTP, KL_MAIL_PORT, KL_MAIL_SENDEMAIL, KL_MAIL_PASSWORD, KL_MAIL_TOEMAIL, $subject, $content, $blogname)) {
    echo '<font color="green">发送成功!请到相应邮箱查收!:)</font>';
}