<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostEmail.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
server.ScriptTimeout =3600
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
end if
if not ef then
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>发送邮件
<%=htmlwrite("html6")%>
<table width="65%"  border="0" cellspacing="1" cellpadding="2">
  <tr>
    <td><br>
        <DIV class="tableborder">
          <table width="100%"  border="0" align="center" cellpadding="2" cellspacing="1">
            <tr align="center" bordercolor="#000000" bgcolor="#999999">
              <td height="24" colspan="4" background="img/tablebg.gif"><font color="#990000"><font color="#FFFFFF">返回信息</font></font></td>
            </tr>
            <tr bordercolor="#000000" bgcolor="#E4EAF2">
              <td width="14%"><font color="#000000">&nbsp; </font></td>
              <td width="86%" colspan="3" align="left"><br>
                  <br>
                  　 成功发送<br>
              <br>
              <%
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
dim Subject,body
Subject=Request.Form ("title")
body =Request.Form ("body")

'ret=Send2Mail(conn,session("agentusername"),Subject,body)

 Set dsSend2Mailagn = Server.CreateObject("ADODB.Recordset")	
		Sql="Select Mailfrom,MailfromName,MailfromPass,MailfromServer,emailendmessage,emailport,EnableSsl from FreeHost.FreeHost_AGENT where username='"&session("agentusername")&"'"
		dsSend2Mailagn.Open Sql,conn,1,1
If not dsSend2Mailagn.Eof Then

if not isnull(dsSend2Mailagn("MailfromServer")) then
if len(dsSend2Mailagn("MailfromServer"))>3 then
Mail_from=dsSend2Mailagn("Mailfrom")
Mail_fromName=dsSend2Mailagn("MailfromName")
Mail_fromPass=dsSend2Mailagn("MailfromPass")
Mail_fromServer=dsSend2Mailagn("MailfromServer")
Mail_emailport=dsSend2Mailagn("emailport")
Mail_EnableSsl=dsSend2Mailagn("EnableSsl")
emailendmessage=dsSend2Mailagn("emailendmessage")

ret=SendJmail(session("agentusername"),Mail_from,Mail_fromName,Request.Form ("email"),Subject,body,Mail_fromServer,Mail_fromPass,Mail_emailport,Mail_EnableSsl)
else%>
您尚未设置邮箱的设置信息,请在用户管理中先设置
<%end If
else%>
您尚未设置邮箱的设置信息,请在用户管理中先设置
<%
End If
End if


'ret=SendJmail(session("admusername"),Application("Mail_from"),Application("Mail_fromName"),Request.Form ("email"),Subject,body,Application("Mail_fromServer"),Application("Mail_fromPass"))
%>
              <%=ret%> </td>
            </tr>
            <tr bordercolor="#000000" bgcolor="#E4EAF2">
              <td height="37" colspan="4" align="right" bgcolor="#E4EAF2"><font color="#000000"> 　　　</font><a href="#top"><font color="#6B9EDE" face="Arial, Helvetica, sans-serif">Top↑</font></a> </td>
            </tr>
          </table>
      </div></td>
  </tr>
</table>
<%=htmlwrite("html7")%>
<%end if
if ef then%>
<%=ec%>
<%end if%>
