Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 52

Thread: TO and CC plus multiple option values.

  1. #21
    Join Date
    May 2008
    Posts
    1,291

    Default Re: TO and CC plus multiple option values.

    Just viewed your current form's source code. It looks like you're using an old perl script and having the email sent to everyone even if their department wasn't selected. The new way should be better, sending an email only to the department intended. Also, Tectite's formmail.php uses the special field "recipients" with an "s" to specify where the results are sent as opposed to the field called "recipient" without the "s" that's used in the perl script you're currently using. Also, that perl script uses a field called "redirect" to specify what page the user is sent to on successful form submission. Tectite formmail.php uses fields called "good_url" and "bad_url" for successful submissions and ones with errors. There's also good_template and bad_template as well as a special script for error handling but those are a completely different topic.

    ginger

  2. #22
    Join Date
    Feb 2013
    Posts
    37

    Default Re: TO and CC plus multiple option values.

    http://www.woodbury.nj.us/contact/

    Its not working. Getting an error.

    This is in place:
    $FORM_INI_FILE = "path to this file/select_list.ini";

    Added the emails:
    $TARGET_EMAIL = array("rleidy@woodbury\.nj\.us$",
    "rkunkle@woodbury\.nj\.us$",
    "rwoerner@woodbury\.nj\.us$",
    "rmerinuk@woodbury\.nj\.us$",
    "kkinkler@woodbury\.nj\.us$",
    "rlaw@woodbury\.nj\.us$");

    This is in the html page:

    <form action="/cgi-bin/formmail_cu.php" method="POST">
    <input type="hidden" name="derive_fields" value="Department=recipients">

    <label>Select which department you would like to contact.</label></td>
    <td valign="top"><select name="recipients" id="recipients" class="select valid">
    <option value="">Select One</option>
    <option value="Public Works">Public Works</option>
    <option value="Construction Office">Construction Office</option>
    <option value="Economic Development">Economic Development</option>
    <option value="Police & Fire">Police & Fire</option>
    <option value="Administration & Other">Administration & Other</option>
    <option value="Website Issues">Website Issues</option>
    </select>


    No idea what could be wrong now.

  3. #23
    Join Date
    May 2008
    Posts
    1,291

    Default Re: TO and CC plus multiple option values.

    You didn't say what error message you were getting.

    Also, your $TARGET_EMAIL settings aren't correct. They're missing the "^" before each email address.

    . . . however, it looks like all of the email addresses you have listed so far are at the same domain so you should be able to just use this (one time):

    Code:
    $TARGET_EMAIL = array(EMAIL_NAME."@woodbury\.nj\.us$");
    EMAIL_NAME takes the place of "any email address at that domain". But like I said in a previous post, if the recipients aren't all at that domain then you need to use the other format with the "^" and each specific email address. You may want to study the examples at the bottom of this page again: http://www.tectite.com/fmdoc/target_email.php

    Also, I see that you still have the ampersand in the "values" section of the option tags. Those values MUST match exactly what you have in the ini file. The part "between" the opening and closing option tags can have the ampersand if you think it looks better to the person filling out the form.

    NOTE: Having said all of this, I just read that in the later versions of formmail, you don't need to set $TARGET_EMAIL if the email addresses are specified in the INI file so in that case, maybe you want to set $TARGET_EMAIL to a blank value:

    Code:
    $TARGET_EMAIL = array();

  4. #24
    Join Date
    Feb 2013
    Posts
    37

    Default Re: TO and CC plus multiple option values.

    Ok, I saw a couple & that were missing in the ini file that were not the same that I had in the form html file so now both are the same.
    <option value="Public Works">Public Works</option>
    <option value="Construction Office">Construction Office</option>
    <option value="Economic Development">Economic Development</option>
    <option value="Police & Fire">Police & Fire</option>
    <option value="Administration & Other">Administration & Other</option>
    <option value="Website Issues">Website Issues</option>

    Public Works = "RLeidy@woodbury.nj.us,KKinkler@woodbury.nj.us"
    Construction Office = "RKunkle@woodbury.nj.us,KKinkler@woodbury.nj.us"
    Economic Development ="RWoerner@woodbury.nj.us,KKinkler@woodbury.nj.us"
    Police & Fire = "RMerinuk@woodbury.nj.us,KKinkler@woodbury.nj.us"
    Administration & Other = "KKinkler@woodbury.nj.us,RLaw@woodbury.nj.us"
    Website Issues = "RLaw@woodbury.nj.us,KKinkler@woodbury.nj.us"


    I took all the emails out of the array and put in this as you said
    $TARGET_EMAIL = array();

    I tried the form again still getting an error. I looked in the log file and found this

    [Sat Feb 16 16:22:23 2013] [error] [client 174.96.229.36] Premature end of script headers: formmail_cu.php, referer: http://www.woodbury.nj.us/contact/










    Quote Originally Posted by ginger23 View Post
    You didn't say what error message you were getting.

    Also, your $TARGET_EMAIL settings aren't correct. They're missing the "^" before each email address.

    . . . however, it looks like all of the email addresses you have listed so far are at the same domain so you should be able to just use this (one time):

    Code:
    $TARGET_EMAIL = array(EMAIL_NAME."@woodbury\.nj\.us$");
    EMAIL_NAME takes the place of "any email address at that domain". But like I said in a previous post, if the recipients aren't all at that domain then you need to use the other format with the "^" and each specific email address. You may want to study the examples at the bottom of this page again: http://www.tectite.com/fmdoc/target_email.php

    Also, I see that you still have the ampersand in the "values" section of the option tags. Those values MUST match exactly what you have in the ini file. The part "between" the opening and closing option tags can have the ampersand if you think it looks better to the person filling out the form.

    NOTE: Having said all of this, I just read that in the later versions of formmail, you don't need to set $TARGET_EMAIL if the email addresses are specified in the INI file so in that case, maybe you want to set $TARGET_EMAIL to a blank value:

    Code:
    $TARGET_EMAIL = array();

  5. #25
    Join Date
    May 2008
    Posts
    1,291

    Default Re: TO and CC plus multiple option values.

    I don't know if ampersands cause problems in INI files but I would NOT use them there. I would use "and" instead, which means you need to use the same thing in the "value" portion of the option tag:

    HTML Code:
    <option value="Police and Fire">Police & Fire</option>
    
    NOT
    
    <option value="Police & Fire">Police & Fire</option>
    Are you getting an error message when you submit the form? Are you receiving an email with an error message?

    I would move formmail.php out of the cgi-bin. It doesn't need to be there, and I've seen some instances where it can cause problems. The default file permissions should be fine.

    What do you have for $FORM_INI_FILE? Did you run testalert to get the "server path"?

    Also, you need to make sure that the select field called "recipients" is a "required" field, otherwise there will be no recipients specified.

    ginger
    Last edited by ginger23; 16-Feb-2013 at 10:06 PM.

  6. #26
    Join Date
    Feb 2013
    Posts
    37

    Default Re: TO and CC plus multiple option values.

    Fixed it

    Police and Fire = "RMerinuk@woodbury.nj.us,KKinkler@woodbury.nj.us"
    Administration and Other = "KKinkler@woodbury.nj.us,RLaw@woodbury.nj.us"

    <option value="Police and Fire">Police & Fire</option>
    <option value="Administration and Other">Administration & Other</option>


    $TARGET_EMAIL = array();

    Where again do you run this "testalert" from?

    Required field? No idea what to do, can you show me? Is there also something that needs to go in the formmail file?

    I moved the php file out of the cgi-bin dir and its in the domain dir now.

    I just submitted the form and no more error but it is showing a blank page and not the thank you page that I have on the server, try it you'll see.

    Is this correct?
    "good_url", "http://www.woodbury.nj.us/thank-you-city-contacts/"











    Quote Originally Posted by ginger23 View Post
    I don't know if ampersands cause problems in INI files but I would NOT use them there. I would use "and" instead, which means you need to use the same thing in the "value" portion of the option tag:

    HTML Code:
    <option value="Police and Fire">Police & Fire</option>
    
    NOT
    
    <option value="Police & Fire">Police & Fire</option>
    Are you getting an error message when you submit the form? Are you receiving an email with an error message?

    I would move formmail.php out of the cgi-bin. It doesn't need to be there, and I've seen some instances where it can cause problems. The default file permissions should be fine.

    What do you have for $FORM_INI_FILE? Did you run testalert to get the "server path"?

    Also, you need to make sure that the select field called "recipients" is a "required" field, otherwise there will be no recipients specified.

    ginger
    Last edited by scottbwc24; 16-Feb-2013 at 10:29 PM.

  7. #27
    Join Date
    May 2008
    Posts
    1,291

    Default Re: TO and CC plus multiple option values.

    This isn't correct:

    <form action="/home/woodbury/woodbury.nj.us/htdocs/formmail_cu.php" method="POST">

    It should be:

    <form action="/formmail_cu.php" method="POST">

    OR the full url:

    <form action="http://www.woodbury.nj.us/formmail_cu.php" method="POST">

    htdocs is NOT part of the url. It's part of the "server path".

    To run testalert you put the following into the address bar:

    http://www.woodbury.nj.us/formmail_cu.php?testalert=1

    If you've specified $DEF_ALERT in formmail.php then you should receive an email showing you the server path to the script.

    $DEF_ALERT is usually the email address of the webmaster, used for troubleshooting error messages when configuring the form.

    As for specifying required fields, it goes in the html of the form:

    HTML Code:
    <input type="hidden" name="required" value="recipients">
    ginger



  8. #28
    Join Date
    Feb 2013
    Posts
    37

    Default Re: TO and CC plus multiple option values.

    So close now. I don't understand why it can't find the php file and its the correct path.

    I did put the ini file in its own dir above the domain and that path is set in the formmail.php file.

    After doing submit I get this
    The website encountered an error while retrieving http://www.woodbury.nj.us/formmail_cu.php. It may be down for maintenance or configured incorrectly.
    That's where it exists. The permissions are set to 640. Does it need to something else?

    $DEF_ALERT does not exist in the formmailphp file anywhere.


    The result is after running it
    Server error

    The website encountered an error while retrieving http://www.woodbury.nj.us/formmail_cu.php?testalert=1. It may be down for maintenance or configured incorrectly.
    Here are some suggestions:

    I also created a new thank you page which is

    "good_url", "http://www.woodbury.nj.us/thank-you-city-contacts/"








    Quote Originally Posted by scottbwc24 View Post
    Fixed it

    Police and Fire = "RMerinuk@woodbury.nj.us,KKinkler@woodbury.nj.us"
    Administration and Other = "KKinkler@woodbury.nj.us,RLaw@woodbury.nj.us"

    <option value="Police and Fire">Police & Fire</option>
    <option value="Administration and Other">Administration & Other</option>


    $TARGET_EMAIL = array();

    Where again do you run this "testalert" from?

    Required field? No idea what to do, can you show me? Is there also something that needs to go in the formmail file?

    I moved the php file out of the cgi-bin dir and its in the domain dir now.

    I just submitted the form and no more error but it is showing a blank page and not the thank you page that I have on the server, try it you'll see.

    Is this correct?
    "good_url", "http://www.woodbury.nj.us/thank-you-city-contacts/"
    Last edited by scottbwc24; 16-Feb-2013 at 10:59 PM.

  9. #29
    Join Date
    May 2008
    Posts
    1,291

    Default Re: TO and CC plus multiple option values.

    Sorry, it looks like this:

    Code:
    define("DEF_ALERT","");
    Put your email address in there:

    Code:
    define("DEF_ALERT","you@yourdomain.com");



  10. #30
    Join Date
    May 2008
    Posts
    1,291

    Default Re: TO and CC plus multiple option values.

    I would set formmail.php permissions to 644.

    ginger

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How do I pass multiple checkbox values?
    By alinsmeier in forum Community Support
    Replies: 4
    Last Post: 22-Feb-2013, 03:43 PM
  2. How to Use the file_names option
    By Frank in forum Community Support
    Replies: 5
    Last Post: 20-Oct-2010, 10:46 PM
  3. Multiple emails in autoresponse from field values?
    By rodev in forum Community Support
    Replies: 5
    Last Post: 30-Aug-2006, 12:19 AM
  4. multiple selection for option group?
    By sutra in forum FormMail Subscription Support
    Replies: 2
    Last Post: 27-Aug-2005, 08:35 AM
  5. Exclude Option
    By zeuseason in forum FormMail Subscription Support
    Replies: 2
    Last Post: 16-Sep-2004, 08:32 PM

Bookmarks

Posting Permissions

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