自己的網站B5教程網,看到很多注冊會員后沒有郵箱驗證,但是會員比較多,一個一個發送郵件很煩,于是就自己二次開發了一個郵件群發功能,現在分享給大家。記得收藏哦!
phpcms v9郵件群發功能是在 用戶=》會員管理 里面實現的,選中要發送的會員,然后郵件群發就行了,如圖:
phpcms v9 郵件群發實現方法
下面是實現步驟:
PHPCMS批量更新文章1.找到phpcms v9里面phpcms/modules/member/templates/member_list.tpl.php 在97行后面添加
2.在member_list.tpl.php的頁面里添加一段js代碼
function emails()
{
PHPCMS批量刪除關鍵詞 var ids='';
$("input[name='userid[]']:checked").each(function(i, n){
ids += $(n).val() + 'PHPCMS批量助手,';
});
if(ids=='') {
window.top.art.dialog({content:'',lock:true,width:'200',height:'50',time:1.5},function(){});
return false;
}
window.top.art.dialog({id:'emails'}).close();
window.top.art.dialog({title:'發送郵件',id:'emails',iframe:'?m=member&c=member&a=emails&ids='+ids,width:'700',height:'400'}, function(){var d = window.top.art.dialog({id:'emails'}).data.iframe;d.$('#dosubmit').click();return false;}PHPCMS批量添加欄目 , function(){window.top.art.dialog({id:'emails'}).close()});
}
3.找到phpcms/modules/member/member.php添加下面代碼:
/**
* 群發郵件
*/
function emails()
{
if(isset($_POST['dosubmit'])) {
pc_base::load_sys_func('mail');
$ids = isset($_POST['emails']['ids']) ? explode(',', $_POST['emails']['ids']): showmessage(L('illegal_parameters'), HTTP_REFERER);
array_pop($ids);
if(!empty($ids)) {
$where = to_sqls($ids, '', 'userid');
$userarr = $this->db->listinfo($where);
$emailetitle=$_POST['emails']['title']." - www.bcty365.com";
PHPCMS批量上傳內容 $emailcontent=$_POST['emails']['content'];
foreach($userarr as $k =>$v)
{
sendmail($v['email'],$emailetitle,$emailcontent);
}
showmessage("郵件發送成功", HTTP_REFERER, '2000', 'emails');
} else {
showmessage(L('illegal_parameters'), HTTP_REFERER, '', 'emails');
}
}else
{
$ids =$_GET['ids'];
include $this->admin_tpl('member_email');
下一篇:站群怎么做SEO才能防止被K
文章地址:http://m.meyanliao.com/article/other/phpcmsvyjqfsxff.html