Click to See Complete Forum and Search --> : [RESOLVED] Conditional Email


drumbum360
02-01-2009, 04:55 PM
I'm using asp to send an email to the user from a form. I have a new scenario I have never encountered before with the form.

I am having the user select if they want a roommate or not for housing. If they pick that they want a roommate they should receive an email telling them about their decision and if they pick that they want a single room they should get a different email pertaining to that selection.
The different emails are completely different from eachother and will not follow the format I am currently using in the code below, if that makes more sense.

How can I use asp to do this? Thanks for your help in advance.

My current code looks like this:
<!-- #include file="../sendEmail.asp" -->
<%
Dim content, incharge

incharge = "Name: " & request("name") & "<br />" & "Would like " & incharge & request("selection")& "<br />" & "ID #: " & incharge & request("id")& "<br />" & "E-mail: " & incharge & request("email")& "<br />" & "Hall: " & incharge & request("hall")& "<br />" & "Room #: " & incharge & request("room")

content = "Thank you, " & request("name")& " , for completing the 2008-2009 room vacancy process form." & "<br />" & " You indicated that you want " & request("selection")& ", and will receive information regarding your decision soon."


sendEmail request("email"), request("email"), "Room Vacancy Form Receipt", content
sendEmail "email@address.edu", request("email"), "AFM Room Vacancy Form", incharge
sendEmail "diffemail@address.com", request("email"), "AFM Room Vacancy Form", incharge

'response.Redirect("www.uwstout.edu/housing")
%>