Intermediary trading http://www.aliyun.com/zixun/aggregation/6858.html"> SEO diagnostic Taobao customer hosting technology hall
B5 web site to see their own website, see a lot of registered members did not verify the mailbox, but more members, one by one to send e-mail annoying, so I developed a second mass mailing function, and now for everyone to share. Remember collection Oh!
phpcms v9 mail bulk function is implemented in the user = "member management, select the members to send, and then mass mail on the line, as shown in Figure:
Here is the implementation steps:
1. Find phpcms v9 phpcms / modules / member / templates / member_list.tpl.php behind the 97 line to add
In the member_list.tpl.php page to add a js code
function emails ()
{
var ids = '';
$ ("input [name = 'userid []': checked"). each (function (i, n) {
ids + = $ (n) .val () + ',';
});
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: 'send mail', 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;}, function ( ) {window.top.art.dialog ({id: 'emails'}). close ()});
}
3. Find phpcms / modules / member / member.php Add the following code:
/ **
* group email
* /
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";
$ emailcontent = $ _ POST ['emails'] ['content'];
foreach ($ userarr as $ k => $ v)
{
sendmail ($ v ['email'], $ emailetitle, $ emailcontent);
}
showmessage ("mail sent successfully", HTTP_REFERER, '2000', 'emails');
} else {
showmessage (L ('illegal_parameters'), HTTP_REFERER, '', 'emails');
}
} else
{
$ ids = $ _ GET ['ids'];
include $ this-> admin_tpl ('member_email');
}
}
Renderings are as follows:
This article address: http: //www.bcty365.com/content-101-993-1.html