The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

contact form to route to different email addresses

I am looking for a PHP script that will send information from a contact form. I have found many of these, but I want to go a step further. I want to have a drop-down on my contact form where the user can select a subject type and based on that selection, the email submitted will go to a different email address. Any help pointing me in the right direction is appreciated.

When processing the form change the recipient email based on the subject area selected:

PHP Code:

// $_POST['subject'] is 0,1,2 depending on what user selected// line up with appropriate email address using the array key$email[0] = 'general@example.com';$email[1] = 'technical@example.com';$email[2] = 'partnerships@example.com';