www.gusucode.com > ASP+ACCESS在线人才招聘网(源代码+论文) > ASP+ACCESS在线人才招聘网(源代码+论文)\admin\mail_all_check.asp

    <!--#include file="session.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/mail.asp"-->
<%
  subject=Request("subject")
  body=Request("body")
  if subject="" then
   result=server.urlEncode("主题不能为空,请返回填写完整")
   Response.Redirect"result.asp?result="&result
  end if
  if body="" then
   result=server.urlEncode("内容不能为空,请返回填写完整")
   Response.Redirect"result.asp?result="&result
  end if
   email="webmaster"
   ut=Request("usertype")
   at=Request("acounttype")   
    Set Rs=Server.CreateObject("Adodb.RecordSet")
   '全部用户
   if ut=0 then
    if at=0 then
     esql="select ep_email as email from enterprise where len(ep_email)>0 "
     psql="select email from job_person where len(email)>0"
	else if at=1 then
	     esql="select ep_email as email from enterprise where len(ep_email)>0 and ep_acount=1"
		 psql="select email from job_person where len(email)>0 and acount=1"
	     else 
		 esql="select ep_email as email from enterprise where len(ep_email)>0 and ep_acount=0"
		 psql="select email from job_person where len(email)>0 and acount=0"
		 end if
    end if
    Rs.Open esql,conn,1,1
    while not rs.eof
     mail Rs("email"),subject,body
     Rs.MoveNext
    Wend
    Rs.Close
	Rs.Open psql,conn,1,1
    while not rs.eof
     mail Rs("email"),subject,body
     Rs.MoveNext
    Wend
    Rs.Close
   end if
   '部分用户 单位用户
   if ut=1 then
    if at=0 then
     esql="select ep_email as email from enterprise where len(ep_email)>0 "
	else if at=1 then
	     esql="select ep_email as email from enterprise where len(ep_email)>0 and ep_acount=1"
	     else 
		 esql="select ep_email as email from enterprise where len(ep_email)>0 and ep_acount=0"
		 end if
    end if
    Rs.Open esql,conn,1,1
    while not rs.eof
     mail Rs("email"),subject,body
     Rs.MoveNext
    Wend
    Rs.Close
   end if
   '部分用户 个人用户
   if ut=2 then
    if at=0 then
     psql="select email from job_person where len(email)>0"
	else if at=1 then
		 psql="select email from job_person where len(email)>0 and acount=1"
	     else
		 psql="select email from job_person where len(email)>0 and acount=0"
		 end if
    end if
	Rs.Open psql,conn,1,1
    while not rs.eof
     mail Rs("email"),subject,body
     Rs.MoveNext
    Wend
    Rs.Close
   end if
   Set Rs=nothing
   Set conn=nothing
   restr="成功群发邮件"
   result=Server.urlEncode(restr)
   Response.Redirect"result.asp?result="&result
  %>