I have this code as part of the action that sends details to admin and user who have registered...
However, I would like the email to be sent also to other address based on the selection in this field..(sectorID) the form has 9 sectors, I.e.
- sector ID 1
- sector ID 2
- sector ID 3
- sector ID 5
- sector ID 6
- sector ID 7
- sector ID 8
- sector ID 9
The emails to the user and the admin works pretty well but I have been un able to work on the other option..
Please help...
'// send email to user
message="You have registered as user at" & " " & url & vbcrlf
' strLabel = "Username"
strLabel = "Username"
message=message & strLabel & ": " & values.Item("username") & vbcrlf
' strLabel = "Passowrd"
strLabel = "Passowrd"
message=message & strLabel & ": " & values.Item("passowrd") & vbcrlf
' strLabel = "Email"
strLabel = "Email"
message=message & strLabel & ": " & values.Item("Email") & vbcrlf
' strLabel = "Sector Name"
strLabel = "Sector Name"
message=message & strLabel & ": " & values.Item("sectorID") & vbcrlf
' strLabel = "Staff Name"
strLabel = "Staff Name"
message=message & strLabel & ": " & values.Item("Staff_Name") & vbcrlf
' strLabel = "Extension"
strLabel = "Extension"
message=message & strLabel & ": " & values.Item("Extension") & vbcrlf
' strLabel = "Mobile Number"
strLabel = "Mobile Number"
message=message & strLabel & ": " & values.Item("Mobile_Number") & vbcrlf
' strLabel = "Land Line Number"
strLabel = "Land Line Number"
message=message & strLabel & ": " & values.Item("Land_Line_Number") & vbcrlf
' strLabel = "Alternative Number"
strLabel = "Alternative Number"
message=message & strLabel & ": " & values.Item("Alternative_Number") & vbcrlf
' strLabel = "Other Email Address"
strLabel = "Other Email Address"
message=message & strLabel & ": " & values.Item("Other_Email_Address") & vbcrlf
' strLabel = "Location (Street, Number)"
strLabel = "Location (Street, Number)"
message=message & strLabel & ": " & values.Item("Location") & vbcrlf
' strLabel = "Residential Area"
strLabel = "Residential Area"
message=message & strLabel & ": " & values.Item("Residential_Area") & vbcrlf
' strLabel = "Closest Police Sation"
strLabel = "Closest Police Sation"
message=message & strLabel & ": " & values.Item("Closest_ Police_Sation") & vbcrlf
Call sendmail(Email,"Notification on registering",message)
'// send letter to admin
message="User registered at" & " " & url & vbcrlf
' strLabel = "Username"
strLabel = "Username"
message=message & strLabel & ": " & values.Item("username") & vbcrlf
' strLabel = "Email"
strLabel = "Email"
message=message & strLabel & ": " & values.Item("Email") & vbcrlf
' strLabel = "Sector Name"
strLabel = "Sector Name"
message=message & strLabel & ": " & values.Item("sectorID") & vbcrlf
' strLabel = "Staff Name"
strLabel = "Staff Name"
message=message & strLabel & ": " & values.Item("Staff_Name") & vbcrlf
' strLabel = "Extension"
strLabel = "Extension"
message=message & strLabel & ": " & values.Item("Extension") & vbcrlf
' strLabel = "Mobile Number"
strLabel = "Mobile Number"
message=message & strLabel & ": " & values.Item("Mobile_Number") & vbcrlf
' strLabel = "Land Line Number"
strLabel = "Land Line Number"
message=message & strLabel & ": " & values.Item("Land_Line_Number") & vbcrlf
' strLabel = "Alternative Number"
strLabel = "Alternative Number"
message=message & strLabel & ": " & values.Item("Alternative_Number") & vbcrlf
' strLabel = "Other Email Address"
strLabel = "Other Email Address"
message=message & strLabel & ": " & values.Item("Other_Email_Address") & vbcrlf
' strLabel = "Location (Street, Number)"
strLabel = "Location (Street, Number)"
message=message & strLabel & ": " & values.Item("Location") & vbcrlf
' strLabel = "Residential Area"
strLabel = "Residential Area"
message=message & strLabel & ": " & values.Item("Residential_Area") & vbcrlf
' strLabel = "Closest Police Sation"
strLabel = "Closest Police Sation"
message=message & strLabel & ": " & values.Item("Closest_ Police_Sation") & vbcrlf
Call sendmail("admin@admin.com","Notification on registering",message)