当前位置: 首页 > 图文教程 > 网络编程 > ASP > ASP+SMTP完成邮件群发功能

ASP
用asp执行DTC
利用ADODB.Stream使用浏览器下载服务器文件
应用数据库的唯一性约束并在asp中捕捉数据库的错误
用ASP编程控制在IIS建立Web站点
asp实现k线图(在线)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(7)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(6)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(5)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(4)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(3)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(2)
在ASP中用EasyMailObject组件处理Exchange邮件源代码(1)
用文本+ASP打造新闻发布系统。几点补充
用文本+ASP打造新闻发布系统(五)新闻修改
用文本+ASP打造新闻发布系统(四)新闻删除
用文本+ASP打造新闻发布系统(三)新闻列表显示
用文本+ASP打造新闻发布系统(二)新闻添加
ASP作的剪包锤游戏
ASP注册表项目修改
构建稳定的服务器端组件的七个步骤

ASP+SMTP完成邮件群发功能


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 47 ::
收藏到网摘: n/a

<%
'<script>window.open('http://www.5790.com');</script>的意思是弹出本站广告..可以删除
Response.Write("<script>window.open('http://www.5790.com');</script>")
%>
<meta http-equiv="Content-Language" content="zh-cn">
<TITLE>中国劲网Web(ASP+STMP)邮件群发系统 2004.11.28 版</TITLE>
<style>
<!--
body         { color: #000000; text-decoration: none; font-family: 宋体; font-size: 10pt;
               letter-spacing: 1pt; font-weight: bold }
table        { font-family: 宋体; font-size: 10pt; text-decoration: none; color: #000000;
               letter-spacing: 1pt; font-weight: bold }
-->
</style>
<%
'imail是接收人长度限制
imail=1001
'设置发信密码
mailpass="
www.5790.com"
post=Request("post")
Response.Cookies("text")=Request("text")
Response.Cookies("title")=Request("title")
if post="openmail" then
smtpmail=Request("smtpmail")
on error resume next

email=Replace(Request("email"),vbCrlf,",")
mailtopic=Request("title")
body=Request("text")&"<br>MTV在线视听:http://www.5790.com"
pass=Request("pass")
if pass<>mailpass then error="请输入正确的发信密码!"
if instr(smtpmail,"@")=0 or smtpmail="" then error="发信E-mail地址填写错误!"
if instr(email,"@")=0 or email="" then error="收信E-mail地址填写错误!"
smail=Split(email,"@")
ubmail=UBound(smail)
if int(ubmail)>int(imail) then error="收信E_mail超出限制!限制一次性发送"&imail&"个邮箱地址"

if error<>"" then
Response.Write(error&"....<a href=?>返回</a>")
Response.End
Else

if Request("amail")="yes" then
mailaddress=email
Set MailObject = Server.CreateObject("CDONTS.NewMail")
MailObject.Send smtpmail,mailaddress,mailtopic,body
Set MailObject=nothing
Response.Write("发送方式:一次性发送<br>收信人列表:"&Request("email")&"<br>信件名:"&Request("title")&"<br>内容:系统不提示<br>发信成功...<a href=?>返回</a>")
If Err Then error="邮件发送失败!错误原因:" & Err.Description & ""
Response.Write("<br>--------共发信给"&ubmail&"邮件地址")
Response.End
Else
smail=Split(email,",")
ubmail=UBound(smail)
for i = 0 to ubmail
mailaddress=smail(i)
Set MailObject = Server.CreateObject("CDONTS.NewMail")
MailObject.Send smtpmail,mailaddress,mailtopic,body
Set MailObject=nothing
Response.Write("--------------------------------<br>发送方式:按邮件地址分批发送<br>收信人列表:"&smail(i)&"<br>信件名:"&Request("title")&"<br>内容:系统不提示<br>发信成功...<a href=?>返回</a><br>")
If Err Then error="邮件发送失败!错误原因:" & Err.Description & ""
next
Response.Write("<br>--------共发信"&ubmail&"封")
Response.End
End if

End if
End if
%>


<div align="center">
  <center>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="700">
  <tr>
    <td width="100%">
    <form method="POST" action="?post=formail">
      <p>生成腾讯QQ邮箱列表----&gt;</p>
      <p>起始点:<input type="text" name="for1" size="20" maxlength="9">&nbsp; 结束点:<input type="text" name="for2" size="20" maxlength="9">&nbsp;
      <input type="submit" valu