惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google DeepMind News
Google DeepMind News
博客园_首页
云风的 BLOG
云风的 BLOG
月光博客
月光博客
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Vercel News
Vercel News
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
D
Docker
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
博客园 - 叶小钗
Martin Fowler
Martin Fowler
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - Sandy

外贸网站 windows错误代码详解 VIVR 主源程... VIVR 转人工函数 - Sandy - 博客园 VIVR 语音留言函数 - Sandy - 博客园 VIVR 发送传真函数 VIVR 接受传真函数 - Sandy - 博客园 VIVR 收听语音留言函数 - Sandy - 博客园 asp函数表 地道英国习语50条 Money can buy happiness, up to a point 得到星期的sql语句和得到月末的sql语句 C#版,冒泡排序-----C#,BubbleSort Who Is Going to Eat It? 建立一个传表名参数的存储过程 北京今天中午感觉到地震 相信自己... 服务器控件和客户端控件的区别 Ajax原理详细说明(转自ibm开发者网站)
Jmail邮件发送程序... - Sandy - 博客园
Sandy · 2007-04-14 · via 博客园 - Sandy


sub SendMaillist()
 dim Sendername,Senderemail,Subject,Content,Priority,InceptType,InceptName,InceptEmail,i,j
 Sendername=trim(request("sendername"))
 Senderemail=trim(request("senderemail"))
 Subject=trim(request("Subject"))
 Content=trim(request("Content"))
 Priority=trim(request("Priority"))
 if Sendername="" then
  FoundErr=True
  ErrMsg=ErrMsg & "<br><li>发件人不能为空!</li>"
 end if
 if Senderemail="" then
  FoundErr=True
  ErrMsg=ErrMsg & "<br><li>发件人Email不能为空!</li>"
 end if
 if Subject="" then
  FoundErr=True
  ErrMsg=ErrMsg & "<br><li>邮件主题不能为空!</li>"
 end if
 if Content="" then
  FoundErr=True
  ErrMsg=ErrMsg & "<br><li>邮件内容不能为空!</li>"
 end if
 if Priority="" then
  Priority=3
 end if
 
 InceptType=Clng(request("incepttype"))
 sql="select UserName,Email from [User] "
 if InceptType=1 then  
  sql=sql & " where Email like '%@%'"  
 elseif InceptType=2 then
  InceptName=replace(replace(replace(replace(request("inceptname")," ",""),"'",""),chr(34),""),"|","','")
  sql=sql & " where UserName in ('" & InceptName & "') and Email like '%@%'"
 elseif InceptType=3 then
  InceptEmail=replace(replace(replace(replace(request("inceptemail")," ",""),"'",""),chr(34),""),"|","','")
  sql=sql & " where Email in ('" & InceptEmail & "')"
 end if
 
 
 if FoundErr=True then
  exit sub
 end if

 set rs=server.createobject("adodb.recordset")
 rs.open sql,conn,1,1
 if rs.bof and rs.eof then
  FoundErr=true
  ErrMsg=ErrMsg & "<br><li>暂时没有用户注册!</li>"
 else    
  response.write "<li>正在发送中,请等待 "
  do while not rs.eof  
   if IsValidEmail(rs("Email"))=True then     
    ErrMsg=SendMail(rs("Email"),rs("UserName"),Subject,Content,Sendername,Senderemail,Priority)
    if ErrMsg<>"" then
     FoundErr=True
     exit sub
    end if
    i=i+1
    response.write "."
   else
    j=j+1    
   end if
   rs.movenext   
  loop
  response.write "<BR><li>成功发送邮件:"&i&"封"
  if j>0 then response.write "<BR><li>未发送邮件:"&j&"封(邮件地址错误)。" end if
 end if
 rs.close
 set rs=nothing
 call CloseConn()
end sub