
<!--#include file="./Conn_mail.asp"-->
<!--#include file="inc/Check.asp"-->
<!--#include file="inc/public.asp"-->
<!--#include file="./F.asp"-->
<%
Makking = Trim(Request.QueryString("Makking"))
ID      = Trim(Request.QueryString("ID"))
select case Makking
case "del"

conn_m.execute("delete from SendMail_Setup where ID= "& ID &"")
		Save_title="·删除成功"   
		call Save_ok()
		
case "Add"

        MailName           = Trim(Request.Form("MailName"))
        MailAddress        = Trim(Request.Form("MailAddress"))
        MailUserName       = Trim(Request.Form("MailUserName"))
        MailUserPass       = Trim(Request.Form("MailUserPass"))
        MailSend           = Trim(Request.Form("MailSend"))
		ok                 = Request.Form("ok")

		Mail            = "info@elight.cn"
		MailNameStr     = ""& MailSend &"邮件设置测试名称"
		MailContent     = ""& MailSend &"邮件设置测试内容"
		MailTitle       = ""& MailSend &"邮件设置测试标题"
		
		IF MailName = "" OR MailAddress = "" OR MailUserName = "" OR MailUserPass = "" OR MailSend = "" Then 
		
		Save_title="·请填写邮件设置内容"   
		call Save_Err()

		END if
		
		Call F_mail()
				
if err then
			
			IF ID ="" Or Not isNumeric(ID) THEN
			
						conn_m.Execute("Insert Into SendMail_Setup (MailName,MailAddress,MailUserName,MailUserPass,MailSend,ok) Values ('"& MailName &"','"& MailAddress &"','"& MailUserName &"','"& MailUserPass &"','"& MailSend &"',"& ok &")")

		Save_title="·添加成功"   
		call Save_ok()
			
			ELSE
			
						conn_m.Execute("Update SendMail_Setup Set MailName='"& MailName &"',MailAddress='"& MailAddress &"',MailUserName='"& MailUserName &"',MailUserPass='"& MailUserPass &"',MailSend='"& MailSend &"',ok="& ok &" where ID="& ID &"")
			
			END IF

		Save_title="·修改成功"   
		call Save_ok()
			
else

		Save_title="·邮件设置失败，请检查邮件设置是否正确"   
		call Save_Err()
		
end if

case ""

	ID     = Trim(Request.QueryString("ID"))
	IF ID  <>"" and isNumeric(ID) THEN
		Set Rs = conn_m.Execute("select * From SendMail_Setup where ID="& ID &"")
		if not(rs.eof and rs.bof) then	
			MailName           = Trim(Rs("MailName"))
			MailAddress        = Trim(Rs("MailAddress"))
			MailUserName       = Trim(Rs("MailUserName"))
			MailUserPass       = Trim(Rs("MailUserPass"))
			MailSend           = Trim(Rs("MailSend"))
			ok                 = Rs("ok")
		END IF
	END IF
	
	
	IF MailName = "" Then
	
	MailName = "互联之光消费引擎"
	
	End if
	
	IF MailUserPass = "" Then
	
	MailUserPass = "xiabole"
	
	End if
	
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ELIGHT.CC</title>
</head>
<link href="Images/Admin.css" rel="stylesheet" type="text/css">
<body>
<table width="98%" height="40"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#D8D8D8">
      <tr>
        <td height="30" align="left" bgcolor="ffffff"><table width="100%" height="100%"  border="0" cellpadding="3" cellspacing="0">
            <tr bgcolor="eeeeee">
              <td width="5%" align="center"><img src="Images/1.gif" width="13" height="12"></td>
                <td width="45%"><span class="style2">管理中心 &gt;&gt;&gt; 添加邮件设置</span></td>
              <td width="50%">&nbsp;</td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="98%" height="90%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D8D8D8">
  <tr>
    <td valign="top" bgcolor="ffffff"><table width="96%"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center" bgcolor="ffffff">
            <form method='POST' name="form" action='SendMail_Setup.asp?Makking=Add&ID=<%=ID%>'>
              <p>&nbsp;</p>
              <table width=100% border=0 align='center' cellpadding=3 
      cellspacing=1 bordercolordark=#ffffff bgcolor="#Eeeeee" class='size09'>
                <tr> 
                  <td width="18%" height="25" align="right" bgcolor="ffffff">邮件服务器：</td>
                  <td height="25" bgcolor="ffffff"><input name="mailaddress" type="text" class="box1" id="mailaddress" value="<%=mailaddress%>" size="60"></td>
                </tr>
                <tr> 
                  <td height="25" align="right" bgcolor="ffffff">发送邮箱：</td>
                  <td height="25" bgcolor="ffffff"><input name="mailsend" type="text" class="box1" id="mailsend" value="<%=mailsend%>" size="60"></td>
                </tr>
                <tr> 
                  <td height="-2" align="right" bgcolor="ffffff">邮箱登录名：</td>
                  <td height="12" bgcolor="ffffff"><input name="mailusername" type="text" class="box1" id="mailusername" value="<%=mailusername%>" size="60"></td>
                </tr>
                <tr> 
                  <td height="-1" align="right" bgcolor="ffffff">邮箱密码：</td>
                  <td height="12" bgcolor="ffffff"><input name="mailuserpass" type="text" class="box1" id="mailuserpass" value="<%=mailuserpass%>" size="60"></td>
                </tr>
                <tr> 
                  <td height="-2" align="right" bgcolor="ffffff">发送人：</td>
                  <td height="12" bgcolor="ffffff"><input name="mailname" type="text" class="box1" id="mailname" value="<%=mailname%>" size="60"></td>
                </tr>
                <tr>
                  <td height="-2" align="right" bgcolor="ffffff">状态：</td>
                  <td height="12" bgcolor="ffffff">
			          <select name="ok">
                      <option value="1" <%if ok = 1 Then%>selected<%end if%>>启用</option>
                      <option value="0" <%if ok = 0 Then%>selected<%end if%>>锁定</option>
                    </select> </td>
                </tr>
              </table>
              <p>
                <input name="B1" type="image" src="Images/add.gif" width="36" height="21" border="0" >
&nbsp;<a href="javascript:history.go(-1)"><img src="Images/back.gif" width="36" height="21" border="0"></a></p>
            </form></td>
        </tr>
      </table>      </td>
  </tr>
</table>
<%end select
Conn_m.Close
Set Conn_m = Nothing
%>
<table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="6"></td>
  </tr>
</table>
</body>
</html>
