I have a dropdown state field in my form. if the user selects AZ or CA then a email gets generated to a particular person when they hit the submit form.If the user has selected PA or WA from the state drop-down then the email is sent to a different person.
So based on what state is selected, the email gets sent to the respective person.
I have wriiten the code, but am not sure, if it is correct.Can anybody please verify.
********************************
'create object of Mail
set objNewMail = Server.CreateObject("CDONTS.NewMail")
with objNewMail
if state = "AZ" THEN
.To = "
[email protected]"
ELSE IF state = "CA" THEN
.TO = "
[email protected]"
ELSE state = "PA"||"WA" THEN
.TO = "
[email protected]"
END IF
.From = "
[email protected]"
.Subject = "Online Scholarship Submission Confirmation"
.BodyFormat = 0
.MailFormat = 0
.Body = strMessage
.Send
End with
set objNewmail = Nothing
'************************************************* ************