|
dim arr,i
currentTable = "TableName"
if keys.Count>0 then
body=""
set rmail=CreateDictionary()
for i=0 to keys.Count-1
arr=split(keys.Item(i)("FieldName"),"&")
if asp_count(arr)>=0 then
set arr2=CreateDictionary()
arr2("FieldName")=asp_urldecode(arr(0))
where =
KeyWhere(arr2,"")
set data =
dal.Table(currentTable).Query(where,"")
body=body
& "OrderID: " & data("OrderID") & vbcrlf
body=body
& "Customer: " & data("CustomerID") & vbcrlf
body=body
& "Employee: " & data("EmployeeID") & vbcrlf _
& "-------------------" & vbcrlf &
vbcrlf
data.close
set data=nothing
end if
next
' send the email
rmail("to")="test@test.com"
rmail("subject")="Sample subject"
rmail("body")=body
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
|