This topic is locked
[SOLVED]

  Send Email to Multiple Addresses in ASP Runner 6.2

8/18/2010 11:48:27 PM
ASPRunnerPro General questions
W
Wallaroo author

I have a project where, once a record has been edited, I need to send an email with a copy to multiple addresses in the "cc" field. The line in question is under tmpDict("cc") below -
msg ="This is an auto generated email to advise of your Leave Application status." & vbcrlf

msg = msg & "" & vbcrlf

msg = msg & "ID: " & dict("ID")& vbcrlf

msg = msg & "Name: " & dict("Name")& vbcrlf

msg = msg & "Staff No: " & dict("StaffNo")& vbcrlf

msg = msg & "Port: " & dict("Port")& vbcrlf

msg = msg & "Leave Start Date: " &format_shortdate(db2time(dict("LeaveStartDate"))) & vbcrlf

msg = msg & "Leave End Date: " &format_shortdate(db2time(dict("LeaveEndDate"))) & vbcrlf

msg = msg & "Leave Type: " & dict("LeaveType")& vbcrlf

msg = msg & "Leave Status: " & dict("LeaveApproved")& vbcrlf

msg = msg & "Comments: " & dict("Comments")& vbcrlf

msg = msg & "Approved/Reviewed By: " & dict("ApprovedBy")& vbcrlf

msg = msg & "Approved/Reviewed Date: " &format_shortdate(db2time(dict("ApprovedDate")))& vbcrlf

msg = msg & "" & vbcrlf

msg = msg & "Should you have any queries regarding this email, please direct them to your Manager - " & dict("ManagerEmail") & vbcrlf
if values("LeaveApproved")= "Approved" then

set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")=dict("Email")

tmpDict("cc")=dict("AllocatorEmail","ResourcePlanner1","ResourcePlanner2")

tmpDict("subject")="LEAVE APPLICATION STATUS"

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

message="An email has been sent to the Employee & Resource Planners"
ElseIf values("LeaveApproved")= "Declined" then

set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")=dict("Email")

tmpDict("subject")="LEAVE APPLICATION STATUS"

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

message="An email has been sent to the Employee"
ElseIf values("LeaveApproved")= "Waitlist" then

set tmpDict = CreateObject("Scripting.Dictionary")

tmpDict("to")=dict("Email")

tmpDict("subject")="LEAVE APPLICATION STATUS"

tmpDict("body")=msg

set ret=runner_mail(tmpDict)

message="An email has been sent to the Employee"
if not ret("mailed") then

response.write ret("message")
end if

end if
Apart from the CC field, everything else works like a dream. Any suggestions?

A
ann 8/19/2010

Wallaro,
here is the correct syntax:

...

tmpDict("cc")=dict("AllocatorEmail")

tmpDict("cc")=tmpDict("cc") & "," & dict("ResourcePlanner1")

tmpDict("cc")=tmpDict("cc") & "," & dict("ResourcePlanner2")

...
W
Wallaroo author 8/19/2010



Wallaro,
here is the correct syntax:

...

tmpDict("cc")=dict("AllocatorEmail")

tmpDict("cc")=tmpDict("cc") & "," & dict("ResourcePlanner1")

tmpDict("cc")=tmpDict("cc") & "," & dict("ResourcePlanner2")

...



G'Day Ann
Thanks very much for your help! It's greatly appreciated!