<{include file="index/header.html"}> 
<div class="nav">
	<a href="?m=api&a=config_email"<{if $smarty.get.a == 'config_email'}> class="ch"<{else}><{/if}>>邮件设置</a>
	<a href="?m=api&a=notice_tpl&type=email"<{if $smarty.get.type == 'email'}> class="ch"<{else}><{/if}>>邮件模板</a> 
</div>
<{if $error_status}> 
	<div class="notice">
		<i><img src="<{$__APP__}>public/images/notice.png" width="20"/></i>
		<span>您的当前不能发送邮件，发送邮件需要支持openssl，如有疑问，可以联系系统官方。</span>
	</div>
<{/if}>
<div class="explain">
	<div class="name"><span>操作提示</span></div>
	<div class="con">
		<p>查看各家接口的数据，接口几乎统一为：465接口。</p>
	</div>
</div> 
<div class="main">
<form action="?m=config&a=post" method="post" back="false">
	<table class="etable">
		<tr>
			<td width="120">发件人名称：</td>
			<td><input type="text" size="36" name="email_name" value="<{$UQCMS.email_name}>"/></td>
	  	</tr>
		<tr>
			<td>SMTP地址：</td>
			<td>
				<input type="text" size="36" name="email_host" value="<{$UQCMS.email_host}>" placeholder="服务商的SMTP地址"/>
				<p>如：smtp.qq.com ,smtp.126.com, smtp.126.com</p>	
			</td>
	  	</tr>
	 	<tr>
			<td>SMTP端口：</td>
			<td>
				<input type="text" size="36" name="email_port" value="<{$UQCMS.email_port}>" placeholder="端口号：一般465"/>
				<p>正常情况下统一为465端口</p>	 
			</td>
	  	</tr> 
	  	<tr>
			<td>SMTP用户名：</td>
			<td><input type="text" size="36" name="email_username" value="<{$UQCMS.email_username}>" placeholder="邮箱用户名"/>
				<p>邮箱的用户名</p>	 
			</td>
	  	</tr>
	 	<tr>
			<td>SMTP密码：</td>
			<td><input type="password" size="36" name="email_password" value="<{$UQCMS.email_password}>" placeholder="邮箱密码"/><p>邮箱的密码</p></td>
	  	</tr> 
		<tr>
			<td>测试收件人：</td>
			<td>
				<input type="text" size="36" id="test_email" placeholder="自己的邮箱，测试发送是否成功。"/>
				<input type="button" value="发送测试邮件" id="test_submit" class="submit2"/>
				<p>发送成功，则短信配置正常，发送失败，则无法使用邮件提醒功能。</p>
			</td>
	  	</tr>
		<tr>
			<td>状态：</td>
			<td>
				<label><input type="radio" name="email_state" value="1" <{if $UQCMS.email_state == '1'}>checked="checked"<{/if}>/> 开启 </label>
				<label><input type="radio" name="email_state" value="0" <{if $UQCMS.email_state == '0' || $UQCMS.email_state == ''}>checked="checked"<{/if}>/> 关闭 </label>
			</td>
	  	</tr>
	  	<tr>
			<td>&nbsp;</td>
			<td><input type="submit" id="submit" value="提交"/></td>
	 	</tr>
	</table>
</form> 
</div>
<{include file="index/footer.html"}> 
<script type="text/javascript">
$(function(){
	$("#test_submit").click(function(){
		$this = $(this);
		var email = $("#test_email").val();
		$.post('?m=config&a=email_test',{email:email},function(result){
			var data = jQuery.parseJSON(result); 
			if(data.error == '0'){
				parent.$.alert('发送成功');
			}else{
				parent.$.alert(data.msg);
			} 
		}); 
	}); 
});
</script>