<!--#include file=../mail.asp-->
<!--#include file=cookies.asp-->
<%
dim smtphost,mail,pass,replyaddress,fs,fobj,nPath,filepath,Submit
Submit=request("Submit")
if Submit<>"" then
filepath=server.mappath("../mail.asp")
if Instr(request("smtphost"),"=")>0 or Instr(request("smtphost"),"%")>0 or Instr(request("smtphost"),chr(32))>0 or Instr(request("smtphost"),"?")>0 or Instr(request("smtphost"),"&")>0 or Instr(request("smtphost"),";")>0 or Instr(request("smtphost"),",")>0 or Instr(request("smtphost"),"'")>0 or Instr(request("smtphost"),",")>0 or Instr(request("smtphost"),chr(34))>0 or Instr(request("smtphost"),chr(9))>0 or Instr(request("smtphost"),"")>0 or Instr(request("smtphost"),"$")>0 then
	response.write "<br>"+"<li>Smtp服务器地址存在非法字符。"
	response.end
end if
if Instr(request("mail"),"=")>0 or Instr(request("mail"),"%")>0 or Instr(request("mail"),chr(32))>0 or Instr(request("mail"),"?")>0 or Instr(request("mail"),"&")>0 or Instr(request("mail"),";")>0 or Instr(request("mail"),",")>0 or Instr(request("mail"),"'")>0 or Instr(request("mail"),",")>0 or Instr(request("mail"),chr(34))>0 or Instr(request("mail"),chr(9))>0 or Instr(request("mail"),"")>0 or Instr(request("mail"),"$")>0 then
	response.write "<br>"+"<li>有效邮箱地址存在非法字符。"
	response.end
end if
if Instr(request("pass"),"=")>0 or Instr(request("pass"),"%")>0 or Instr(request("pass"),chr(32))>0 or Instr(request("pass"),"?")>0 or Instr(request("pass"),"&")>0 or Instr(request("pass"),";")>0 or Instr(request("pass"),",")>0 or Instr(request("pass"),"'")>0 or Instr(request("pass"),",")>0 or Instr(request("pass"),chr(34))>0 or Instr(request("pass"),chr(9))>0 or Instr(request("pass"),"")>0 or Instr(request("pass"),"$")>0 then
	response.write "<br>"+"<li>访问密码存在非法字符。不能有“等符号！"
	response.end
end if
if Instr(request("replyaddress"),"=")>0 or Instr(request("replyaddress"),"%")>0 or Instr(request("replyaddress"),chr(32))>0 or Instr(request("replyaddress"),"?")>0 or Instr(request("replyaddress"),"&")>0 or Instr(request("replyaddress"),";")>0 or Instr(request("replyaddress"),",")>0 or Instr(request("replyaddress"),"'")>0 or Instr(request("replyaddress"),",")>0 or Instr(request("replyaddress"),chr(34))>0 or Instr(request("replyaddress"),chr(9))>0 or Instr(request("replyaddress"),"")>0 or Instr(request("replyaddress"),"$")>0 then
	response.write "<br>"+"<li>发信人邮箱存在非法字符。"
	response.end
end if
smtphost=request("smtphost")
mail=request("mail")
pass=request("pass")
replyaddress=request("replyaddress")
Set fobj = Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT")
Set fs = fobj.CreateTextFile(filepath,true)
fs.Write("<"&chr(37)&chr(10))
fs.Write("dim mailname,mailpass,mailform,mailsmtp"&chr(10))
fs.Write("mailname="&chr(34)&mail&chr(34))
fs.Write(chr(13)&chr(10))
fs.Write("mailpass="&chr(34)&pass&chr(34))
fs.Write(chr(13)&chr(10))
fs.Write("mailform="&chr(34)&replyaddress&chr(34))
fs.Write(chr(13)&chr(10))
fs.Write("mailsmtp="&chr(34)&smtphost&chr(34)&chr(10))
fs.Write(chr(37)&">")
fs.close
response.write "<SCRIPT language=JavaScript>alert('设置邮件服务器成功！')</SCRIPT>"
response.write "<meta http-equiv=refresh content=""1;URL=adminmail.asp"">"
response.end
else
%>
<link href="inc_style.css" rel="stylesheet" type="text/css">
<p align="center"><img border="0" src="img/list_bo.gif"></p>
<form name="form1" method="POST" action="adminmail.asp">
<div align="center">
<table border="1" cellspacing="0" cellpadding="4" bgcolor="#F5F5F5" width="363" style="border-collapse: collapse" bordercolor="#CCCCCC">
<tr> 
<td bgcolor="#FEEEBC" height="25"><b>邮件系统设置</b></td>
</tr>
<tr> 
<td bgcolor="#FFFBEE" align="center"> 
<table width="90%" border="0" cellspacing="0" cellpadding="6">
<tr> 
<td>Smtp服务器</td>
<td> 
<input type="text" name="smtphost" value="<%=mailsmtp%>" size="20">
</td>
</tr>
<tr> 
<td>有效邮箱</td>
<td> 
<input type="text" name="mail" value="<%=mailname%>" size="20">
</td>
</tr>
<tr> 
<td>访问密码</td>
<td> 
<input name="pass" value="<%=mailpass%>" size="20" type="password"></td>
</tr>
<tr> 
<td>发信人邮箱</td>
<td> 
<input type="text" name="replyaddress" value="<%=mailform%>" size="20"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#FEEEBC" align="center"> 
<input type="submit" name="Submit" value="确定设定" class="Tips_bo">
</td>
</tr>
<tr>
<td bgcolor="#FEEEBC" align="center"> 
<p align="left">说明：本功能需要FSO组件支持，如果你的空间不支持FSO，请手动修改根目录下的mail.asp文件，里面有说明！</td>
</tr>
</table>
</div>
</form>
<%end if%>