This topic is locked
[SOLVED]

 Send Email after record add with table values

2/11/2011 10:16:56 AM
ASPRunnerPro General questions
G
GerryT author

ASPRunner 6.0
The code that i have for 6.3 does not work when inserting it in to version 6.0 for sending table vaules in the subject line, so I am hoping someone can help with making it work with 6.0.
Below is a snipet from 6.0 to send new data after record added and the 6.3 snipet that does what i need it to.
6.0 Version
'** Send email with new data ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
Dim dkeys

message =""
dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next
email="test@test.com"

subject="New data record"
sendmail email, subject, message
6.3 Version
'** Send email with new data ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
Dim dkeys, tmpDict, msg, n

msg =""
dkeys = values.keys

For n = 0 To values.Count-1

if not IsBinaryType(GetFieldType(dkeys(n),"")) then

msg = msg & dkeys(n) & " : " & values(dkeys(n)) & vbcrlf

end if

Next
set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")="email@email.com"

tmpDict("subject")=values("Department") & " Escalation Account# " & values("Account_Number")

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

if not ret("mailed") then

response.write ret("message")

end if