    <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="19"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
 <!--#include file="../rolecheck.asp"-->



   <script language="javascript">
<!--
function checks()
{
 
if(document.sendmail.frommail.value=="")
{
alert("发信人不能为空!");
return false;
}
if(document.sendmail.selects.options.value=="null")
{
alert("请选者收件人类型!");
return false;

}
 if(document.sendmail.mailsubject.value=="")
{
alert("请输入信件标题!");
return false;

}


if(document.sendmail.content.value=="")
{
alert("请输入信件内容!");
return false;

}


if(document.sendmail.frommail1.value=="")
{
var i=confirm("你没有输入附加收信人地址！那么将进行群发邮件！你确定要群发吗？");
if(i)
{
return true;
}
else
{
return false;
}
}
 }
 function istrues()
 {
 var i=confirm("你确定要进行自动匹配商机发送吗？此操作可能消耗较多资源！");
 if(i)
 {
 return true;
 }
 else
 {
 return false;
 }
 }
//-->
</script>
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<%

	Function IsObjInstalled(strClassString)
		on error resume next
		IsObjInstalled = False
		Err = 0
		Dim xTestObj
		Set xTestObj = Server.CreateObject(strClassString)
		If 0 = Err Then IsObjInstalled = True
		Set xTestObj = Nothing
		Err = 0
	End Function
 	Dim theInstalledObjects(0)
     theInstalledObjects(0) = "JMail.SMTPMail"
	 
 %>
<style type="text/css">
<!--
.STYLE1 {
	color: #FFFFFF;
	font-weight: bold;
}
.STYLE2 {color: #FF0000}
-->
</style>
<table width="98%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#7698DD" class="a2">
 	<tr bgcolor="#D6DFEF" class="a4">
		<td height="30" align="center" bgcolor="#7698DD">
      
      <span class="STYLE1">发 送 邮 件</span>  <br>      </td>
 	</tr><tr><td height="20">
      Jmail组件支持：
      <%If Not IsObjInstalled(theInstalledObjects(0)) Then%><font color="red">对不起！不能用Jmail组件发送邮件,需安装了jmail组件才可发送邮件！<b>×</b></font><%else%><b><font color="red">√</font></b><%end if%>
    </td></tr><tr><td>
     <table border="0"  bordercolor="#B8CFE4" cellpadding="0"  cellspacing="0" align="center" width="100%" >
	 <form name="emform" method="post" action="sendinfoemail.asp" onsubmit="return istrues();"><tr><td  >  
 	 <font   color="#0099CC">提示：由于随着会员数量的增加和订阅商机有关的供求信息的增加，会造成系统定时自动发送时消耗大量的服务器资源而引起系统无法正常运行！由此采用后台事件触发的方式进行发送，以缓解上述问题的严重性！请不要随意的触发此功能！后果自负！</font></td></tr><tr><td height="40" align="center" valign="middle" bgcolor="#D6DFEF"> 
 	       <input type="submit" name="sendgo" value="点击进行订阅商机自动匹配发送至会员Email处理"   />
  </td></tr>
	<tr><td bgcolor="#0099CC"  height="2" ></td></tr>
	</form></table>
	
  	 <form  method="post"  name="sendmail"action="Bs_Mail_hy.asp">
	 
	  
	  <table cellspacing="1" cellpadding="0"  bordercolor="#FFFFFF" bordercolordark="#000000" bordercolorlight="#000000" >
	  <TR>
    <TD width="97" height="25" align="middle">发信人邮箱地址</TD>
    <TD width="609" height="25"><input name="frommail" type="text" value="<%=SystemEmail%>" size="30"  />(默认设置在基本设置中)</TD>
  </TR>
   <TR>
    <TD align="middle" height="25">发信人邮箱密码</TD>
    <TD height="25"><input name="mail_pwd" type="password" id="mail_pwd" value="<%=HOPE_MailPwd%>" size="30" >(默认设置在基本设置中)</TD>
  </TR>
   <TR>
    <TD align="middle" height="25">邮件服务器地址</TD>
    <TD height="25"><input name="mail_smtp" type="text" id="mail_smtp" value="<%=SMTPServer%>" size="30" >(默认设置在基本设置中)</TD>
  </TR>
  <TR>
    <TD align="middle" height="25">收件人邮箱地址</TD>
    <TD height="25"><TEXTAREA name="frommail1"   cols="70" ><%
	if Emailinfo<>"" then
	Emailinfo=""
	end if
	%></TEXTAREA><br>
      <span class="STYLE2">(附加收件人地址,可选项,多个用户请用“,”号隔开)</span></TD>
  </TR>
  <TR>
    <TD align="middle" height="25">收件人邮箱类型</TD>

    <TD height="25"><select size="1" name="selects" >
        <option value="null"  selected="selected"  style="color:#0099CC"><--会员类型--></option>
        <%
		
set rss=server.CreateObject("adodb.recordset")
sqls="select * from Websen_vipgrade order by id desc"
rss.open sqls,conn,1,1
roleid=rss("roleid")
if not rss.eof then 
do while not rss.eof 

%>
        <option value="<%=rss("roleid")%>" style="color:#0099CC"><%=rss("gradename")%></option>
	    
        <%
	
rss.movenext
loop
rss.close
end if
%>
            </select>
      (收件人同时还包括以上手工输入的邮箱地址)</TD>
  </TR>
  <TR>
    <TD align="middle" height="25">是否使用HTML</TD>
    <TD height="25"><INPUT type="radio" <%if Emaillei=0 then%> CHECKED <%end if%> value="0" name="ms_ifhtm">
      不使用
      <INPUT type="radio" value="1" <%if Emaillei=1 then%> CHECKED <%end if%> name="ms_ifhtm">
      使用 (发送邮件解析格式)</TD>
  </TR>
  <TR>
    <TD align="middle" height="25">邮件标题</TD>
    <TD height="25"><INPUT size="60" name="mailsubject" value="<%=EmailTitle%>">    </TD>
  </TR>
  <TR>
    <TD align="middle" height="25">邮件正文</TD>
    <TD height="25"><span class="STYLE2">〖*注意不要输入带有JS脚本和非法字符〗</span></TD>
  </TR>
  <TR>
    <TD align="middle" height="25">收件人邮件内容</TD>
    <TD height="25"><TEXTAREA NAME="content"  id="content"   rows="12" cols="75"  style="display:none;" ><%
sql1="select mailbody from websen_worldec_Temp "
Set rs1= Server.CreateObject("ADODB.Recordset") 
rs1.open sql1,conn,1,3
If isnull(rs1("mailbody")) Then 
'if rs1("mailbody")<>"" then
response.Write "请输入邮件内容"
else
response.Write rs1("mailbody")
end if
rs1.close
set rs1=nothing
%></TEXTAREA>
<iframe ID="eWebEditor1" src="../../editor/ewebeditor.asp?id=content&style=standard&originalfilename=d_originalfilename &savefilename=d_savefilename &savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="617" HEIGHT="450">
</iframe> </TD>
  </TR>
  <TR>
    <TD align="middle" height="25"></TD>
    <TD height="25"> <div align="center">
      <%
			 If   IsObjInstalled(theInstalledObjects(0)) Then
			 %>
      <input type="submit" value="下一步"   onclick="return checks();" />
      <%else%>
      <input type="submit" value="没有安装邮件组件"    disabled="disabled"/>
      <%end if%>
    </div></TD>
  </TR>

</table>
 </form> 
 	  
  