To send an email with new data to email addresses from the user table, use the following code in one of the following events:
•Add page: Before record added
•Edit page: Before record updated
•Edit page: After record updated
set rmail=CreateDictionary()
set data = dal.Table("users").QueryAll()
while not data.eof
' send the email
rmail("to")=data("email")
rmail("subject")="Sample subject"
rmail("body")="Sample body"
set result = runner_mail(rmail)
' if error happened print a message on the web page
if not result("mailed") then
response.write result("message") & "<br>"
response.flush
end if
data.MoveNext
wend
data.close: data=nothing
See also: