kokomo310 Posted December 12, 2007 Share Posted December 12, 2007 Hi. I am creating a website that uses and online job application. This company has a franchise, so we would like the results of the application to be emailed directly to the correct franchisee. If we have a dropdown that contains the various franchise locations, is there a way to specify when someone chooses "Washington State" that results are emailed to "washington@ourfranchise.com", "Colorado Springs, CO" would go to "colorado@ourfranchise.com"? Thank you for your help! Quote Link to comment Share on other sites More sharing options...
farkewie Posted December 12, 2007 Share Posted December 12, 2007 just make the value the email address <select name="email"> <option value="location$??.com">location1</option> <option value="locaion2@???.com">location2</option> </select> and in the script similar to the following use the link to get all the mail functions <?php $to = $_POST['email']; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> http://www.php.net/manual/en/function.mail.php Quote Link to comment Share on other sites More sharing options...
sanguinious Posted December 12, 2007 Share Posted December 12, 2007 Set the each option value to the corresponding email address, <form name="jobs" action="<?=$_SERVER['PHP_SELF'];?>" method="POST"> <select name="email_to"> <option value="me@me.com">me</option> <option value="him@him.com">him</option> </select> <input type="submit" value="submit" name="submit"> </form> Then for the from on the email just use $_POST['email_to']; Angus. Quote Link to comment Share on other sites More sharing options...
kokomo310 Posted December 12, 2007 Author Share Posted December 12, 2007 Thank you for your quick responses! I'm a little confused about the first solution as I need to direct the employment information gathered on our html form to the different email addresses. Our html form is being processed via formmail.php and the results are emailed to us using a txt template. I *THINK* the second solution may be more in line with what I am trying to do? I will try and let you know. If I'm misunderstanding the first solution, please accept my apology and I would love more insight. Quote Link to comment Share on other sites More sharing options...
Stephen68 Posted December 12, 2007 Share Posted December 12, 2007 I think the first response was the same as the second, he just put some text in for a value instead of fake email address. The top of his post says... just make the value the email address hehe.. had me going there until I took a second look at it Cheers! Stephen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.