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

推荐订阅源

G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 【当耐特】
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
罗磊的独立博客
宝玉的分享
宝玉的分享
月光博客
月光博客
V
V2EX
博客园 - 司徒正美
Vercel News
Vercel News
量子位
Y
Y Combinator Blog
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
博客园 - Franky
小众软件
小众软件
I
InfoQ
A
About on SuperTechFans

博客园 - 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