phpcms v9 mail bulk method

Source: Internet
Author: User
Tags aliyun authentication content developed dialog e-mail emails function

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.