|
response.Flush
dim arr,i
currentTable = "TableName"
if keys.Count>0 then
email_list=""
set rmail=CreateDictionary()
for i=0 to keys.Count-1
arr=split(keys.Item(i)("KeyColumn"),"&")
if asp_count(arr)>=0 then
set arr2=CreateDictionary()
arr2("KeyColumn")=asp_urldecode(arr(0))
where =
KeyWhere(arr2,"")
set data =
dal.Table(currentTable).Query(where,"")
if data("EmailField")<>"" then
email_list=email_list & data("EmailField") & ","
end if
data.close
set data=nothing
end if
next
if email_list<>"" then
email_list =
left(email_list,len(email_list)-1)
end if
' send the email
rmail("to")=email_list
rmail("subject")="Sample subject"
rmail("body")="Your email message here"
set arr = runner_mail(rmail)
result("txt") = "Emails were sent."
' if error happened print a message on the
web page
if arr("mailed") then
errmsg = "Error happened:
<br>"
errmsg = errmsg &
"File: "
&
arr("source") & "<br>"
errmsg = errmsg &
"Line: "
&
arr("number") & "<br>"
errmsg = errmsg &
"Description:
" &
arr("description") & "<br>"
result("txt") = errmsg
end if
end if
|