在ASP中发送邮件---在线等

tangcx 2005-07-21 09:35:57
在ASP中发送邮件的原件码是怎么样????
用到那个组件
...全文
410 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
tianya2003 2005-07-21
  • 打赏
  • 举报
回复
<%
'作者:小艺
'联系QQ:52093
'网址:http://www.5790.com
'版本:中国劲网Web(ASP+STMP)邮件群发系统 2004.11.28 版
'欢迎大家光临本网站:http://www.5790.com
'请不要删除版权,此源码可以做非商业化传播
'<script>window.open('http://www.5790.com');</script>的意思是弹出本站广告..可以删除
Response.Write("<script>window.open('http://www.5790.com');</script>")
%>
<!--
'作者:小艺
'联系QQ:52093
'网址:http://www.5790.com
'版本:中国劲网Web(ASP+STMP)邮件群发系统 2004.11.28 版
'欢迎大家光临本网站:http://www.5790.com
-->
<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&"邮件地址----www.5790.com----小艺开发---联系QQ:52093---")
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&"封----www.5790.com----小艺开发---联系QQ:52093---")
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邮箱列表----></p>
<p>起始点:<input type="text" name="for1" size="20" maxlength="9">  结束点:<input type="text" name="for2" size="20" maxlength="9"> 
<input type="submit" value="提交" name="B1">
<input type="reset" value="重置" name="B2"></p>
</form>
</td>
</tr>
<tr>
<td width="100%">
<form method="POST" action="?post=openmail">
<p>发送邮件:</p>
<p><input type="text" name="smtpmail" size="74" value="mtv@mtv.com"></p>
<p>收信地址:<input type="radio" value="yes" name="amail" checked>一次性群发 
<input type="radio" value="no" name="amail">按邮件地址分批发送</p>
<p><textarea rows="7" name="email" cols="73"><%
if post="formail" then
Session("t")=Replace(time(),":","")
for1=Request("for1")
for2=Request("for2")
if not isnumeric(for1) then error="起始点..中只能输入数字,如果想用英文名邮箱,请直接在邮件列表框中输入!"
if not isnumeric(for2) then error="结束点..中只能输入数字,如果想用英文名邮箱,请直接在邮件列表框中输入!"
if error<>"" then
Response.Write(error)
Else
'限制生成列表
if int(for2)-int(for1)>int(imail) then
Response.Write("生成列表失败!收信E_mail超出限制!限制一次性发送"&imail&"个邮箱地址")
else
for i = int(for1) to int(for2)
email=i&"@qq.com"&vbCrlf
Response.Write(email)
next
End if
End if
tt=int(Replace(time(),":",""))-int(Session("t"))
End if
%></textarea>
<%if post="formail" then
Response.Write("运行时间为:"&tt&"s")
End if
%></p>
<p>信件标题:</p>
<p><input type="text" name="title" size="74" value="<%=Request.Cookies("title")%>"></p>
<p>信件内容:</p>
<p><textarea rows="8" name="text" cols="73"><%=Request.Cookies("text")%></textarea></p>
<p>发信密码(用此系统发信需要密码):<input type="text" name="pass" size="40" maxlength="9"></p>
<p><input type="submit" value="提交" name="B1">
<input type="reset" value="重置" name="B2"></p>
</form>
</td>
</tr>
</table></center>
</div>

jackycxg 2005-07-21
  • 打赏
  • 举报
回复
没有 安装JMAIL组件,不过我安装了,用这代码做,也还是出现发送不成功的情况
tangcx 2005-07-21
  • 打赏
  • 举报
回复
以上的代码运行时出现错误。

错误类型:


Microsoft JScript 编译错误 (0x800A03EC)
缺少 ';'
/design/test/send_email.asp, line 15, column 4
set jmail=server.CreateObject("jmail.message") '创建对象
---^


浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; TencentTraveler )

网页:
GET /design/test/send_email.asp
yangfan2008 2005-07-21
  • 打赏
  • 举报
回复
jmail
tangcx 2005-07-21
  • 打赏
  • 举报
回复
已经找到原代码,有兴趣的参考一下:
<html>
<head>
<title>Jmail邮件发送</title>
<body>
<%
Set jmail = Server.CreateObject("JMAIL.Message") '建立发送邮件的对象
'jmail.silent = true '屏蔽例外错误,返回FALSE跟TRUE两值j
jmail.Charset = "GB2312" '邮件的文字编码
jmail.ContentType = "text/html" '邮件的格式为HTML格式或纯文本
jmail.AddRecipient "test@yourdomain.com" '邮件收件人的地址
jmail.From = "webmaster@yourdomain.com" '发件人的E-MAIL地址
jmail.MailServerUserName = "webmaster@yourdomain.com" '登录邮件服务器的用户名 (您的邮件地址)
jmail.MailServerPassword = "123456" '登录邮件服务器的密码 (您的邮件密码)
jmail.Subject = "Mail Subject" '邮件的标题
jmail.Body = "Mail Body" '邮件的内容
jmail.Priority = 1 '邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值
jmail.Send("mail.yourdomain.com") '执行邮件发送(通过邮件服务器地址)
jmail.Close()
set jmail = nothing
%>
<center>

邮件发送成功!

</center>
</body>
</html>
iamgsyy 2005-07-21
  • 打赏
  • 举报
回复
不用组件能不能发email 啊?

jmail这个组件服务器上有吗?
阿_浩 2005-07-21
  • 打赏
  • 举报
回复
jmail 搜索一下到处都是

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧