Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Location
    Kansas
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Multiple emails on Forms

    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. Any ideas? I appreciate the help.

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    If I understand you, this should work:

    In your form:
    Code:
    <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>
    </select>
    Then fill the To: header with the post value of categories

    PS- your link doesnt work

    HTH
    Dan
    Last edited by whizard; 06-11-2007 at 08:57 PM.
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New to the CF scene
    Join Date
    Jun 2007
    Location
    Kansas
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ooops

    Sorry. Will check it out and see if that works for me. THANKS!

  • #4
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    Quote Originally Posted by whizard View Post
    PS- your link doesnt work
    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.
    Last edited by kbluhm; 06-11-2007 at 09:36 PM.

  • #5
    New to the CF scene
    Join Date
    Jun 2007
    Location
    Kansas
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Last part

    What do you mean by the To: header with the post value of categories?

  • #6
    New to the CF scene
    Join Date
    Jun 2007
    Location
    Kansas
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Overwhelmed

    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.

  • #7
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Sounds like a good time to demand a raise

  • #8
    New to the CF scene
    Join Date
    Jun 2007
    Location
    Kansas
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Yep it does

    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

  • #9
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    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

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #10
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,151
    Thanks
    2
    Thanked 335 Times in 327 Posts
    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.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •