This topic is locked
[SOLVED]

 Send Email with Field as subject?

1/24/2011 4:44:43 PM
ASPRunnerPro General questions
G
GerryT author

I am looking to send an email to user(s) as a new record is submitted, I have the standard one that you can make with the "add action" but i am unsure how to place a field in as the subject line. Any help, I would appreciate it.
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")="New Ticket"

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

if not ret("mailed") then

response.write ret("message")

end if

Sergey Kornilov admin 1/24/2011

Instead of

tmpDict("subject")="New Ticket"
try this

tmpDict("subject")=values("Some field name here")

G
GerryT author 1/24/2011

If I wanted to include 2 fields in the subject how would I add that?
Thank you for all of your help!!!

J
jmclain 1/25/2011

Use & . . .



tmpDict("subject")=values("Some field name here") & " optional text if needed " & values("Second field name")
G
GerryT author 1/25/2011

Thanks!!
Issue Resolved