怎么实现邮件逐个发送?急用!

xiaoding1 2005-04-28 08:53:52
我现在想做商情订阅,就是给订阅商情的用户发送一封email。
下面是代码,帮忙看一下

<!--#include file="inc/conn.asp"-->
‘判断用户是否订阅(若订阅ifsq=1)
<%
sql="select shangqing,ifsq,email from company where ifsq=1"
set rsu=conn.execute(sql)
if rsu("email")<>"" and not rsu.eof then
do while not rsu.eof
email=trim(rsu("email"))
%>

<%

mbmail=email
title="商情咨询(now())"


neirong=neirong&"<html><body>"
neirong=neirong&"<table>"

neirong=neirong&"<tr><td><font color=#FF0000>求购</font></td>"
neirong=neirong&"<td求够</td></tr>"
neirong=neirong&"<tr><td></td>"
neirong=neirong&"<td><font color=#0000ff></font></td></tr>"
neirong=neirong&"</table>"
neirong=neirong&"</body></html>"
Sub SendMail(strFrom, strTo, strSubject, strBody, lngImportance, lngAType, strAttach)

Dim objMail

Set objMail = Server.CreateObject("CDONTS.NEWMAIL")
With objMail
.From = strFrom
.To = strTo
.Subject = strSubject
.Body = strBody
.Importance = lngImportance

If lngAType = 1 Then
.BodyFormat = 0
.MailFormat = 0
End If

If IsEmpty(strAttach) = False And IsNull(strAttach) = False Then
.AttachFile strAttach
End If

.Send
End With
Set objMail = Nothing

End Sub
'=======================================================================================
%>
<% rsu.movenext
loop
end if
set rsu=nothing%>
</body>
</html>
...全文
59 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,406

社区成员

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

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