<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("EmailAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsphemail = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Email where id='"&session("EmailAUID")&"'"
	dsphemail.Open Sql,conn,1,1
if dsphemail.Eof then
	ef=True
	ec="不存在的邮箱产品ID！"
end if
end if

if not ef then
	Set dspdl = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_EmailProductlist where Emailtype='"&dsphemail ("Emailtype")&"'"
		dspdl.Open Sql,conn,1,1
If dspdl.Eof Then
	ef=True
	ec="不存在的邮箱产品类型！"
Else
emailcount=dspdl("emailcount")
If Not IsNull(dsphemail("emailcount")) Then emailcount=dsphemail("emailcount")
end if
end if

if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerEmaillist where id='"&dsphemail ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
end if
end if

if not ef then
Set dspdallemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_ALLEmail where PdEID='"&dsphemail ("id")&"' and emailname is not null order by emailname"
		dspdallemail.Open Sql,conn,1,1
if  not dspdallemail.eof then
emailarryX=split(dspdallemail("emailname"),"@")
domainhaveset=emailarryX(1)
haveadmset=true
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/template-emailadm-top.asp"-->
 邮箱自助管理
 
 <TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
   <TBODY>
     <TR>
       <TD width="20%" height="50" vAlign=middle bgColor=#9E9E9E>&nbsp; <font color="#FFFFFF">产品详情：</font></TD>
       <TD width="35%" height="50" bgColor=#ffffff>　产品类型：
           <%
	Emailtype=dspdl("Emailtype")
	info=dspdl("info")
	Set ori_email_name = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_EmailProductlist where Emailtype='"&Emailtype&"'"
		ori_email_name.Open Sql,conn,1,1
		if not ori_email_name.eof then
Set newname_email = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_EmailProductlist_AGN where agent1='"&dsphemail("agent1")&"' and id='"&ori_email_name("id")&"'"
		newname_email.Open Sql,conn,1,1
if not newname_email.eof then
Emailtype=newname_email("Emailtype")
info=newname_email("info")
end if
		end if

	%>
           <%=Emailtype%> </TD>
       <TD width="45%" height="50" bgColor=#ffffff>　服务器IP：<%=dsserver("ip")%> <br>
         　请将域名MX记录解析到本IP　
         </TD>
     </TR>
     <TR>
       <TD width="20%" rowspan="7" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
       <TD height="40" bgColor=#ffffff>　开通时间：<%=formatdatetime(dsphemail("starttime"),1)%></TD>
       <TD width="45%" height="40" bgColor=#ffffff>　到期时间：<%=formatdatetime(dsphemail("endtime"),1)%></TD>
     </TR>
     <TR>
       <TD height="40" bgColor=#ffffff>　邮箱数量：<%=emailcount%>个</TD>
       <TD width="45%" height="40" bgColor=#ffffff>　状态：
           <%if dsphemail("endtime")>NOW then%>
           <%if dsphemail("istest")="y" then%>
           <font color="#FF0000">试用</font>
           <%else%>
           <%=dsphemail("status")%>
           <%end if%>
           <%else%>
           <font color="#FF0000">过期</font>
           <%if dsphemail("status")="暂停" then%>
           <br>
           <font color="#FF0000">暂停</font>
           <%end if%>
           <%end if%></TD>
     </TR>
     <TR>
       <TD height="40" bgColor=#ffffff>　域大小：<%=dsphemail("domainspacelimt")%>M</TD>
       <TD height="40" bgColor=#ffffff>　单个邮箱大小：<%=dsphemail("userspacelimt")%>M</TD>
     </TR>
     <TR>
       <TD height="40" bgColor=#ffffff>　已绑定域名：<%=domainhaveset%></TD>
       <TD height="40" bgColor=#ffffff>　管理邮箱：<%if haveadmset then%><%=dspdallemail("emailname")%><%else%>无<%end if%>
         　</TD>
     </TR>
     <TR>
       <TD height="122" bgColor=#ffffff>　Web访问地址：</TD>
       <TD height="122" bgColor=#ffffff>　公用访问地址：<a href="<%=dsserver("webdomain")%>"><font color="#000000"><%=dsserver("webdomain")%></font></a><br>
         　除了公用地址，您也可以将<br>　<%if haveadmset then%>mail.<%=domainhaveset%><%else%>mail.域名<%end if%>
         <br>         　解析到邮箱服务器IP上<br>
　您就可以用 <%if haveadmset then%><a href="http://mail.<%=domainhaveset%>">http://mail.<%=domainhaveset%></a><%else%>mail.域名<%end if%><br>
 　来直接访问您的邮箱</TD>
     </TR>
     <TR>
       <TD height="40" bgColor=#ffffff>　POP3地址：</TD>
       <TD height="40" bgColor=#ffffff>　<a href="<%=dsserver("webdomain")%>"><font color="#000000"><%=dsserver("popdomain")%></font></a></TD>
     </TR>
     <TR>
       <TD height="40" bgColor=#ffffff>　SMTP地址：</TD>
       <TD height="40" bgColor=#ffffff>　<a href="<%=dsserver("webdomain")%>"><font color="#000000"><%=dsserver("smtpdomain")%></font></a></TD>
     </TR>
   </TBODY>
 </TABLE>
 

 <%If session("username")<>"" Then%>
 <br>
　<a href="/user/mailadm.asp"><font color="#000000">[返回用户区]</font></a> <br>
<br>
<%end if%>
<!--#include virtual="/inc-freehost-function/template-emailadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>