在线建站培训
您的位置: 魔客吧 cms教程 ecshop教程 查看内容

ECSHOP教程:快速添加手动发送邮件插件

2017-1-4 17:01 | 发布者: moke | 栏目:ecshop教程


4、编辑admin下include下的inc_menu.php文件,添加如下代码:
$modules['16_email_manage']['sendmail']=’sendmail.php?act=sendmail’;
5、编辑languages下zh_cn下admin下common.php文件,添加如下代码:
$_LANG['sendmail']=’发送邮件’;
总结:该插件能兼容2.7.2以上的版本,并且可以在用户管理里面进行发送邮件,使用前请正确的设置邮件服务器。

查看更多 ecshop教程 ecshop模板

1.找到主程序admin添加php文件为sendmail.php,如果您的admin那个文件夹更改了就到相应的文件下去。添加以下代码:

define(‘IN_ECS’, true);
require(dirname(__FILE__) . ‘/includes/init.php’);
/* 模板赋值 */
$smarty->assign(‘ur_here’, $_LANG['sendmail']);
if($_REQUEST['act'] == ‘sendmail’)
{
$email = trim($_REQUEST['email']);

include_once(ROOT_PATH . ‘includes/fckeditor/fckeditor.php’); //类文件
create_HTML_editor(‘content’, ”);

$smarty->assign(‘email’, $email);
$smarty->display(‘sendmail.htm’);
}
if($_REQUEST['act'] == ‘send_act’)
{
$email = trim($_REQUEST['email']);
$subject = trim($_REQUEST['subject']);
$content = trim($_REQUEST['content']);

if(send_mail($_CFG['shop_name'], $email, $subject, $content, 1))
{
sys_msg($_LANG['send_sucess'], 0);
}
else
{
sys_msg($_LANG['send_failure'], 1);
}
}
?>
2.找到languages目录下zh_cn目录下admin目录下添加php文件为:sendmail.php,添加如下代码:
$_LANG['sendmail'] = “发送邮件”;
$_LANG['send_sucess'] = “邮件发送成功!”;
$_LANG['send_failure'] = “邮件发送失败!”;
$_LANG['recipient'] = ‘收件人’;
$ _LANG['subject'] = ‘主题’;
$_LANG['content'] = ‘邮件正文’;
$_LANG['button_send'] = ‘发送’;

$_LANG['js_languages']['invalid_email'] = ‘没有输入邮件地址或者输入了一个无效的邮件地址。’;
$_LANG['js_languages']['no_subject'] = ‘没有输入邮件主题。’;
$_LANG['js_languages']['no_content'] = ‘没有输入邮件正文。’;
?>
3、编辑admin下templates下的user_list.html文件,代码如下:






javascript:confirm_redirect(‘{if $user.user_money ne 0}{$lang.still_accounts}{/if}{$lang.remove_confirm}’, ‘users.php?act=remove&id={$user.user_id}’)” title=”{$lang.remove}”>

最新分享资源

最新评论