<script language="javascript">
$(function(){
	$("#addFormSet").form('load',{
		'email':'<?php echo $info["email"] ?>',
		'smtp':'<?php echo $info["smtp"] ?>',
		'ssl':'<?php echo $info["ssl"] ?>',
		'port':'<?php echo $info["port"] ?>',
		'MailPwd':'<?php echo $info["MailPwd"] ?>',
		'MailPwd2':'<?php echo $info["MailPwd"] ?>'
	});
});
function onRepwd(){
	$.messager.progress();
	$("#addFormSet").form('submit',{
		url:'__APP__?g=<?php echo GROUP_NAME; ?>&m=<?php echo MODULE_NAME; ?>&a=setpwd&id=<?php echo $id ?>&go=1',
		onSubmit: function(){
			var isValid = $(this).form('validate');
			if (!isValid){
				$.messager.progress('close');
			}
			return isValid;
		},
		success:function(data){
			$.messager.progress('close');
			if(data==1){
				$.messager.alert('提示','邮箱设置成功！','info',function(){
					var sa = '{$TC.config.SUBMIT_ACTION}';
					if(sa==1){
						cancel['Setpwd'].dialog('close');
						cancel['Setpwd'] = null;
					}
				});
			}else if(data==-1){
				$.messager.alert('提示','确认密码不正确！','warning');
			}else{
				$.messager.alert('提示','邮箱设置失败！','warning');
			}
		}
	});
}

function onReset(){
	cancel['Setpwd'].dialog('close');
	cancel['Setpwd'] = null;
}
</script>
<div class="con-tb">
<form id="addFormSet" method="post">
 <table class="infobox" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="23%"><label for="username">帐号</label></td>
    <td width="77%">{$info.username}</td>
  </tr>
  <tr>
    <td width="28%"><label for="smtp">SMTP服务器</label></td>
    <td width="72%"><input name="smtp" type="text" class="easyui-validatebox" size="28" data-options="required:true" /></td>
  </tr>
  <tr>
    <td width="28%"><label for="ssl">安全连接(SSL)</label></td>
    <td width="72%">
    <select class="easyui-combobox" name="ssl">  
    	<option  value="0">关闭</option>  
        <option value="1">开启</option>  
    </select> (一般情况为：关闭)
   </td>
  </tr>
  <tr>
    <td width="28%"><label for="port">服务器端口</label></td>
    <td width="72%"><input name="port" type="text" class="easyui-numberbox" size="16" data-options="value:25,required:true" /></td>
  </tr>
  <tr>
    <td width="23%"><label for="email">邮箱</label></td>
    <td width="77%"><input name="email" type="text" class="easyui-validatebox" value="" size="42" data-options="required:true,validType:'email'" /></td>
  </tr>
  <tr>
    <td width="23%"><label for="MailPwd">邮箱密码</label></td>
    <td width="77%"> <input name="MailPwd" type="password" class="easyui-validatebox"  size="20" data-options="required:true" /></td>
  </tr>
  <tr>
    <td width="23%"><label for="MailPwd2">确认密码</label></td>
    <td width="77%"> <input name="MailPwd2" type="password" class="easyui-validatebox"  size="20" data-options="required:true" /></td>
  </tr>
  <tr>
    <td height="38" colspan="2" align="center"><a href="javascript:void(0);" onclick="javascript:onRepwd()" id="su" class="easyui-linkbutton" data-options="iconCls:'icon-save'">修改</a> &nbsp; <a href="javascript:void(0);" onclick="javascript:onReset()" id="re" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">关闭</a></td>
  </tr>
 </table>
</form>
</div>