123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- {include file="public/layout" /}
- <body class="bodystyle" style="overflow-y: scroll;min-width:auto;">
- <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
- <div id="append_parent"></div>
- <div id="ajaxwaitid"></div>
- <div class="page min-hg-c-i" style="min-width: auto;box-shadow:none;">
- <div class="fixed-bar">
- <div class="item-title">
- {neq name='$goback' value='off'}
- <a class="back_xin" href="{:url('System/api_conf')}" title="返回"><i class="iconfont e-fanhui"></i></a>
- {/neq}
- <div class="subject">
- <h3>电子邮箱</h3>
- <h5></h5>
- </div>
- <ul class="tab-base nc-row">
- {eq name="'System@smtp'|is_check_access" value="1"}
- <li><a href="{:url('System/smtp')}" {if condition="'smtp'==$Think.const.ACTION_NAME"}class="current"{/if}><span>邮箱配置</span></a></li>
- {/eq}
-
- {eq name="'System@smtp_tpl'|is_check_access" value="1"}
- <li><a href="{:url('System/smtp_tpl')}" {if condition="'smtp_tpl'==$Think.const.ACTION_NAME"}class="current"{/if}><span>自定义模板</span></a></li>
- {/eq}
- </ul>
- </div>
- </div>
- <form class="form-horizontal" id="handlepost" method="post">
- <div class="ncap-form-default">
- <dl class="row">
- <dt class="tit">
- <label for="smtp_server"><em>*</em>SMTP地址</label>
- </dt>
- <dd class="opt">
- <input id="smtp_server" name="smtp_server" value="{$smtp.smtp_server|default=''}" class="input-txt" type="text" autocomplete="off" />
- <p class="notic2">发送邮箱的smtp地址。如: smtp.qq.com或smtp.gmail.com</p>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="smtp_port"><em>*</em>SMTP端口</label>
- </dt>
- <dd class="opt">
- <input id="smtp_port" name="smtp_port" value="{if condition="isset($smtp['smtp_port'])"}{$smtp['smtp_port']|default=''}{else /}465{/if}" class="input-txt" type="text" autocomplete="off"/>
- <p class="notic2"><span style="color: red;">注意:大部分默认为465,具体请参看各STMP服务商的设置说明,极少部分是25或其他端口号。</span>
- </p>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="smtp_user"><em>*</em>发信邮箱账号</label>
- </dt>
- <dd class="opt">
- <input id="smtp_user" name="smtp_user" value="{$smtp.smtp_user|default=''}" class="input-txt" type="text" autocomplete="off"/>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit">
- <label for="smtp_pwd"><em>*</em>邮箱授权码</label>
- </dt>
- <dd class="opt">
- <input id="smtp_pwd" name="smtp_pwd" value="{$smtp.smtp_pwd|default=''}" class="input-txt" type="text" autocomplete="off"/>
- <p class="notic2">使用发送邮件的邮箱授权码。具体请点击参看【<a href="JavaScript:void(0);" data-href="https://www.eyoucms.com/plus/view.php?aid=5552&origin_eycms=1" onclick="openFullframe(this,'获取邮箱授权码');">使用指南</a>】</p>
- </dd>
- </dl>
- <dl class="row">
- <dt class="tit"><em>*</em>管理员邮箱账号</dt>
- <dd class="opt">
- <input value="{$smtp.smtp_from_eamil|default=''}" name="smtp_from_eamil" id="smtp_from_eamil" placeholder="多个邮箱可以用逗号隔开" class="input-txt" type="text" onkeyup="this.value=this.value.replace(/,/g,',');" onpaste="this.value=this.value.replace(/,/g,',')" autocomplete="off">
- <input value="测试发送" class="input-btn" onclick="sendEmail();" type="button">
- <p class="notic">多个邮箱可以用逗号隔开</p>
- </dd>
- </dl>
-
- <dl class="row">
- <dt class="tit">接收提醒选项</dt>
- <dd class="opt">
- <ul class="nc-row ncap-waybill-list">
- <li style="width: 100%;">
- {foreach name="tpl_list" item="vo" key="k" }
- <label class="label">
- <input class="check" type="checkbox" name="tpl_id[]" value="{$vo.tpl_id}" {eq name="$vo.is_open" value="1" }checked="checked"{/eq}><span>{$vo.tpl_name}</span>
- </label>
-
- {/foreach}
- </li>
- </ul>
- </dd>
- </dl>
-
- <div class="bot">
- <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="submit_smtp();">确认提交</a>
- </div>
- </div>
- </form>
- </div>
- <script type="text/javascript">
- var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- // 提交邮箱配置
- function submit_smtp() {
- var smtp_server = $.trim($('input[name="smtp_server"]').val());
- var smtp_user = $.trim($('input[name="smtp_user"]').val());
- var smtp_pwd = $.trim($('input[name="smtp_pwd"]').val());
- var smtp_from_eamil = $.trim($('input[name="smtp_from_eamil"]').val());
-
- if (smtp_server != '' || smtp_user != '' || smtp_pwd != '' || smtp_from_eamil != '') {
- if (smtp_server == '') {
- showErrorMsg('邮件发送服务器不能为空!');
- $('input[name=smtp_server]').focus();
- return false;
- }
- if (smtp_user == '' || !checkEmail(smtp_user)) {
- showErrorMsg('邮箱账号的格式不正确!');
- $('input[name=smtp_user]').focus();
- return false;
- }
- if (smtp_pwd == '') {
- showErrorMsg('邮箱授权码不能为空!');
- $('input[name=smtp_pwd]').focus();
- return false;
- }
- if (smtp_from_eamil == '') {
- showErrorMsg('接收的邮件地址不能为空!');
- $('input[name=smtp_from_eamil]').focus();
- return false;
- }
- }
-
- layer_loading("正在处理");
- $.ajax({
- url: "{:url('System/smtp', ['goback'=>$goback,'_ajax'=>1])}",
- type: 'POST',
- dataType: 'JSON',
- data: $('#handlepost').serialize(),
- success: function(res) {
- layer.closeAll();
- if (1 == res.code) {
- layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
- window.location.reload();
- });
- } else {
- var icon = 5;
- try{
- if (res.data.icon) {
- icon = res.data.icon;
- }
- }catch(e){}
- showErrorAlert(res.msg, icon);
- }
- },
- error: function(e){
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- });
- }
-
- // 测试邮箱发送
- function sendEmail() {
- var email = $('#smtp_from_eamil').val();
- if (email == '') {
- showErrorMsg('接收的邮件地址不能为空!');
- $('input[name=smtp_from_eamil]').focus();
- return false;
- } else {
- var loading = layer_loading('正在发送');
- $.ajax({
- type: "post",
- data: $('#handlepost').serialize(),
- dataType: 'json',
- url: "{:url('System/send_email', ['_ajax'=>1])}",
- success: function (res) {
- layer.closeAll();
- if (res.code == 1) {
- layer.msg(res.msg, {icon: 1, time:1000});
- } else {
- layer.msg(res.msg, {icon: 2, time: 2000});
- }
- },
- error: function(e) {
- layer.closeAll();
- showErrorAlert(e.responseText);
- }
- })
- }
- }
- </script>
-
- {include file="public/footer" /}
|