找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 4676|回复: 0

Discuz sendmail函数实现 发表回帖邮件通知楼主方法

[复制链接]
发表于 2016-12-7 11:58:34 | 显示全部楼层 |阅读模式
打开目录:source\include\post
找到文件:post_newreply.php

找到下面代码:
  1. if(!isset($inspacecpshare)) {

  2.                 showmessage($return , $url, $modpost->param('showmsgparam'));

  3.         }
复制代码
在这段代码之前添加如下代码:


  1. if($firstpost['author'] != $_G['uid']){
  2.     $tomail = reset(C::t('common_member')->fetch_all_by_username($firstpost['author']));
  3.     $mail_subject = '您的帖子有新回复!';
  4.     $mail_message = <<<EOT
  5. <table cellpadding="6" cellspacing="0" width="100%" style="width:650px;margin:0 auto;font-size:12px;">
  6.                 <tbody><tr>
  7.                         <td width="640" style="border-bottom:1px solid #e0e0e0;text-align:right;" colspan="2">
  8.                                 <table cellpadding="0" cellspacing="0">
  9.                                         <tbody><tr>
  10.                                                 <td valign="bottom"><img src="http://www.dz7.com.cn/template/dz7_tuhao1/images/logo.png" style="vertical-align: bottom"></td>
  11.                                                 <td width="600" style="text-align:right" valign="bottom"><a href="http://www.dz7.com.cn/member.php?mod=logging&amp;action=login" style="font-size:14px;color:#0082d5;text-decoration:none;" target="_blank">登录</a> | <a href="http://www.dz7.com.cn/member.php?mod=register" style="font-size:14px;color:#0082d5;text-decoration:none" target="_blank">注册</a></td>
  12.                                         </tr>
  13.                                 </tbody></table>
  14.                         </td>
  15.                 </tr>
  16.                 <tr>
  17.                         <td style="font-size:14px;line-height:25px;">尊敬的DZ起点网会员:<span style="border-bottom: 1px dashed rgb(204, 204, 204); z-index: 1; position: static;" t="7" data="{$firstpost['author']}" isout="1">{$firstpost['author']}</span><br><br>有新网友回复了您在起点网发布的帖子《<a href="http://www.dz7.com.cn/discuz-{$firstpost['tid']}-1-1.html" target="_blank">{$firstpost['subject']}</a>》<br><br>详情请点击这里打开查看:<a href="http://www.dz7.com.cn/discuz-{$firstpost['tid']}-1-1.html">http://www.dz7.com.cn/discuz-{$firstpost['tid']}-1-1.html</a>。<br><br>DZ起点网,您的坚强后盾!</td>
  18.                 </tr>
  19.                 <tr>
  20.                         <td style="text-indent:1.3em;font-size:14px;line-height:25px;border-bottom:1px solid #e0e0e0"><br></td>
  21.                 </tr>
  22.                 <tr>
  23.                         <td style="color:#8a8a8a;font-size:12px;padding-left:24px;line-height:20px;"><br><div style="text-align: center;"><img src="https://set3.mail.qq.com/cgi-bin/download?sid=o98wstGkas_ITGI6&amp;upfile=nnTDFYo6EOWktJwwFfeKsGThsfTBA4MSoChZT6Ln501bLjpernjAItEu3H8eNv0v4MVo7imxxO%2F9K7OhWM3L5EbZqCtNtEA4PiDgltAlJP7b6cJiwrTeNsbLmCITuQMI" modifysize="25%" diffpixels="-1px" style="width: 124px; height: 125px;">&nbsp; &nbsp;</div><div style="text-align: center;"><span style="text-align: start;">如有任何疑问,可以添加DZ起点网站长QQ、微信进行咨询!</span></div></td>
  24.                 </tr>
  25.                 <tr>
  26.                         <td style="color:#8a8a8a;font-size:12px;padding-left:24px;line-height:20px;">每一位DZ起点网的会员人,都在默默无闻的,帮助着新手站长朋友快速成长,解决站长朋友们在建站过程中的疑问!<br><div style="text-align: right;">-- DZ起点网</div></td></tr>
  27.         </tbody></table>
  28. EOT;
  29.     if(!function_exists('sendmail')) {
  30.         include libfile('function/mail');
  31.     }
  32.     sendmail($tomail['email'], $mail_subject, $mail_message);
  33.         }
复制代码


即可实现回帖邮件通知楼主!


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|Discuz代码分析|Discuz目录结构|DZ起点网 ( 蜀ICP备13000518号-15 )

GMT+8, 2024-4-26 04:47 , Processed in 0.048029 second(s), 17 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表