For the Code Gurus - Email Submit to Different Destinations per Field Value - HOW
Hi to all,
I have a form that works fine and submits to one email address and Bccs two others; however, I want to be able to use their dropdown box choice for LOCATION and have it direct to that location's specific email.
The location field has assigned number values for: Cox Blvd = 1, Chisholm Rd = 2, etc..
What code do I change the destination email to below to make it depend on the 4 locations I have in the LOCATION field values for 1, 2, 3 and value 4?
I know there is a simple way to have it go to cox@xxxx.com if value '1' is selected from the dropdown box (location) or chisholm@xxxx.com if value '2' is selected from the dropdown, etc.. on to the fourth location.
Does anyone know the code snippet that needs to replace the current $emailto = or how I would do this?
well from what i'm seeing here you need is something simple. now first off instead of using the mail function(which for a list of reasons isn't really reliable) i suggest you take a look at phpmailer. now then back on the subject. why not do something like
I probably should have placed my entire form code as I have no idea where that type of code would be inserted. Can you look at the full code and tell me after/before what is where the code you suggested placed?
The main page with the form fields itself has the dropdown box for the LOCATION variable that will decide the email destination depending on which value is selected as:
I tried, but line 179 is the second to last line that has:
exit; only on it and that did not work.
I apologize for your frustration and perhaps it is better someone else post an answer that might work to avoid any unecessary frustration on your part.
Can anyone actually tell this novice here between what to lines of code (using text) the propsed code would be inserted as line 179 at the very end of the code ('exit;'), per the suggested answer before is incorrect?