View Full Version : Multiple emails on Forms

06-11-2007, 08:47 PM
I need assign different email addresses according to a drop down list of categories. It is set up to submit a classified ad (https://secure.townnews.com/shared-c...ate=classified) and you have to select a category for your ad, i.e. employment, announcements, etc. I would like to assign a different email to each of these categories. Some of the categories actually have 2 or 3 email addresses they need to go to as well. :thumbsup: Any ideas? I appreciate the help.

06-11-2007, 08:55 PM
If I understand you, this should work:

In your form:

<select name="categories">
<option value="employment@isp.com">Employment</option>
<option value="announcements@isp.com,secondaddress@isp.com">Announcements</option>
<option value="etc@isp.com">Etc</option>

Then fill the To: header with the post value of categories

PS- your link doesnt work :p :)


06-11-2007, 09:00 PM
Sorry. Will check it out and see if that works for me. THANKS!

06-11-2007, 09:31 PM
PS- your link doesnt work :p :)
When the URL matches link text containing an ellipsis, 99 our of 100 times it has been copied/pasted to multiple forums from the message text rather than the editor. She probably posted the message in 5 or 6 different places to get as many answers a possible and was unaware that vBulletin shortens the link text of long URLs. It's careless and more often than not renders the message useless to those who would like to help.

06-11-2007, 09:54 PM
What do you mean by the To: header with the post value of categories?

06-11-2007, 09:55 PM
Sorry for being careless. My boss was let go and I'm trying to do things I've not done before. Twice the work... ugh.

06-11-2007, 09:57 PM
Sounds like a good time to demand a raise :D

06-11-2007, 09:59 PM
They gave me a puny one, not enough to get excited about. Now I can buy an extra lunch at McDonald's every month...LOL

06-11-2007, 11:17 PM
I assume, since you posted in the PHP forum, that you have a PHP script which sends the emails?

If so, the file sets the recipient of the email at some point. The value you want to be used for the To: header is the value from the dropdown box, or $_POST['categories'], using my example


06-12-2007, 12:20 AM
This is a continuation of this thread - http://www.codingforums.com/showthread.php?t=116140

The categories already exist on the form (at least they did when I looked at the link in the post), it is just necessary that the form processing code be modified to read the category value selected and set the To: email address accordingly.