怎么实现邮件逐个发送?急用!
我现在想做商情订阅,就是给订阅商情的用户发送一封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>