Results 1 to 7 of 7

Thread: nmsFormMail throws error for no apparent reason

  1. #1
    Registered
    Join Date
    Dec 2008
    Location
    in a house
    Posts
    3
    Rep Power
    0

    Question nmsFormMail throws error for no apparent reason

    Greetings, I am new to powweb and seem to be experiencing some trouble with my customized nmsFormMail script.

    As far as I can tell everything seems to be in order but when I attempt to use the script via my website's contact page I get an error from formmail.

    Below I have included the exact error text followed by the relevant part of FormMail.cgi script (slightly editted) followed by the relevant form html from the page in question.

    (NOTE: I bolded a section in error and the html portion I thought would fix it.)

    I am no programmer and am at a loss to find the problem on my own. I assume since FormMail is throwing the error it is somewhat working but I am not sure what I'm missing. Anyone that might have an idea to help would be greatly appreciated.

    Thanks in advance

    EccentricEgg
    <spamomlet <AT> eccentric egg<dot>com>

    Error Message:
    "Error: GET request

    The HTML form fails to specify the POST method, so it would not be correct for this script to take any action in response to your request.

    If you are attempting to configure this form to run with FormMail, you need to set the request method to POST in the opening form tag, like this: <form action="/cgi-bin/FormMail.pl" method="post">

    nms FormMail 2001 London Perl Mongers
    Written as drop-in replacement for FormMail at Matt's Script Archive"
    relevant FormMail.cgi section:
    Code:
    "
    
    BEGIN
    {
      $DEBUGGING         = 1;
      $emulate_matts_code= 0;
      $secure            = 1;
      $allow_empty_ref   = 1;
      $max_recipients    = 15;
      $mailprog          = '/usr/sbin/sendmail -oi -t';
      $postmaster        = 'postal@eccentricegg.com';
      @referers          = qw(eccentricegg.com localhost);
      @allow_mail_to     = qw(eccentricegg.com addy1@gmail.com otheraddy+default@gmail.com otheraddy+web@gmail.com otheraddy+postmaster@gmail.com  otheraddy+info@gmail.com otheraddy+ads@gmail.com productguy@yahoo.com localhost);
      @recipients        = ();
      %recipient_alias = (
        'default' => 'addy1@eccentricegg.com,otheraddy+default@gmail.com',
        'ad' => 'someonelse@eccentricegg.com,otheraddy+ads@gmail.com',
        'in' => 'anotherperson@eccentricegg.com,otheraddy+info@gmail.com',
    	'merch' => 'anybody@eccentricegg.com,otheraddy+products@gmail.com,productguy@yahoo.com',
    	'theegg' => 'addy1@eccentricegg.com,otheraddy+theegg@gmail.com',
        'website' => 'addy3@eccentricegg.com,otheraddy+web@gmail.com',
        );
    #                     In the HTML form that should submit to the recipient 'two@your.domain', you would then set the recipient with:
    #                     <input type="hidden" name="recipient" value="2" />
    #
    #                     The recipients in %recipient_alias are automatically added
    #                      to the allowed recipients list, so there's no need to list
    #                      them all in @allow_mail_to as well.
    
      @valid_ENV         = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
      $locale            = '';
      $charset           = 'iso-8859-1';
      $date_fmt          = '%A, %B %d, %Y at %H:%M:%S';
      $style             = '/screen.css';
      $no_content        = 0;
      $double_spacing    = 1;
      $wrap_text         = 0;
      $wrap_style        = 1;
      $address_style     = 0;
      $send_confirmation_mail = 0;
      $confirmation_text = <<'END_OF_CONFIRMATION';
    From: you@your.com
    Subject: form submission
    
    Thank you for your form submission.
    
    END_OF_CONFIRMATION
    
    
    "
    relevant html section:
    HTML Code:
    "
    
    [B]<form action="/cgi-bin/FormMail.cgi" method="post">[/B]
    
    	<input type="hidden" name="required" value="recipient,email,comments" />
    
    	<input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT,REMOTE_ADDR" /> <!-- hopefully appends with next line enviroment variables-->
    	
    	<input type="hidden" name="sort" value="order:recipient,subject,comments,realname,email,env_report" />
    			
    	<input type="hidden" name="redirect" value="http://www.eccentricegg.com/successfulform.html" />
    			
    	<div><label for="recipient">Please choose the Topic area to best respond to your message:<span class="notice">(required)</span></label>
    		<select name="recipient" id="recipient">
    			<option value="default" selected>Default</option> 
    			<option value="in">Information</option>
    			<option value="ad">Advertising</option>
    			<option value="merch">Merchandise</option>
    			<option value="theegg">TheEccentricEgg</option>
    			<option value="website">Website</option>
    		</select>
    	</div>	
    
    	<div><label for="realname">What is your name?</label>
    		<input type="text" name="realname" maxlength="60" class="txt"/></td>
    	</div>
    
    	<div><label for="email">Please enter your email address:<span class="notice">(required)</span></label>
    		<input type="text" name="email" maxlength="60" class="txt"/>
    	</div>
    
     	<div><label for="subject">Please enter a Subject for this message:</label>
    		<input type="text" name="subject" maxlength="60" class="txt"/>
    	</div>
    
    	<div><label for="comments">Please enter any questions, comments, concerns or suggestions:<span class="notice">(required)</span></label>
    		<textarea name="comments">We are always looking for the best ways to serve our readers.</textarea>
    	</div>
       
    	<div>
    		<input type="SUBMIT" value="Send Message" class="btn"/>
    		<input type="RESET" value="Reset Form" class="btn"/>
    	</div>
    
    </form>
    	
    "

  2. #2
    Custom User Title tpoynton's Avatar
    Join Date
    Sep 2004
    Location
    Mass
    Posts
    2,177
    Rep Power
    18
    Providing a link to the form is helpful...I found it, and the W3.org validator found 54 errors that you might consider to get the form working. Errors surrounding tags and the buttons would be where I would start. you could try clicking the 'clean up with htmltidy' button and revalidate, which has often fixed errors for me. good luck, and welcome to the forum!

  3. #3
    Jess's Avatar
    Join Date
    Nov 2001
    Location
    Planet Earth
    Posts
    289
    Rep Power
    16
    FormMail is a perl script. So this part of your code is incorrect:
    <form action="/cgi-bin/FormMail.cgi" method="post">

    Should be:
    <form action="/cgi-bin/FormMail.pl" method="post">

  4. #4
    Registered
    Join Date
    Dec 2008
    Location
    in a house
    Posts
    3
    Rep Power
    0

    Valid xhtml still getting FormMail error

    OK I have editted the webpage so that it now validates (thanks tpoynton for the link) but I still get this error:
    Error: GET request

    The HTML form fails to specify the POST method, so it would not be correct for this script to take any action in response to your request.

    If you are attempting to configure this form to run with FormMail, you need to set the request method to POST in the opening form tag, like this: <form action="/cgi-bin/FormMail.pl" method="post">

    nms FormMail 2001 London Perl Mongers
    Written as drop-in replacement for FormMail at Matt's Script Archive
    I was thinking. Do I need to escape the "+" in some of the email addresses used in the following?
    @allow_mail_to = qw(eccentricegg.com addy1@gmail.com otheraddy+default@gmail.com otheraddy+web@gmail.com otheraddy+postmaster@gmail.com otheraddy+info@gmail.com otheraddy+ads@gmail.com productguy@yahoo.com localhost);
    @recipients = ();
    %recipient_alias = (
    'default' => 'addy1@eccentricegg.com,otheraddy+default@gmail.co m',
    'ad' => 'someonelse@eccentricegg.com,otheraddy+ads@gmail.c om',
    'in' => 'anotherperson@eccentricegg.com,otheraddy+info@gma il.com',
    'merch' => 'anybody@eccentricegg.com,otheraddy+products@gmail .com,productguy@yahoo.com',
    'theegg' => 'addy1@eccentricegg.com,otheraddy+theegg@gmail.com ',
    'website' => 'addy3@eccentricegg.com,otheraddy+web@gmail.com',
    );
    Still stuck as it stands and I'm running out of ideas

  5. #5
    PowWeb Staff mpk's Avatar
    Join Date
    Dec 2008
    Location
    united states
    Posts
    148
    Rep Power
    9
    I was able to get it working by changing the filename of the form processor from FormMail.pl to myscript.pl. The reference in contact.shtml has been updated accordingly. Apparently we have an anti spam filter running silently on the backend to change any post request to obvious formmail scripts to get requests.

  6. #6
    Registered
    Join Date
    Dec 2008
    Location
    in a house
    Posts
    3
    Rep Power
    0

    Smile Success

    Thanks mpk!
    Apparently we have an anti spam filter running silently on the backend to change any post request to obvious formmail scripts to get requests.
    This might be a good thing to let users know. Just a suggestion

  7. #7
    Former Spam Filter (EU) IanS's Avatar
    Join Date
    Mar 2004
    Location
    Washington (THE original UK one!)
    Posts
    12,964
    Rep Power
    30
    Quote Originally Posted by eccentricegg View Post
    Thanks mpk!

    This might be a good thing to let users know. Just a suggestion
    Or a bad thing to publicise to all the spammers out there

    Letting support know would be a very good idea!
    This is a Powweb customer
    helping Powweb customer forum.

    I am a customer just like you!!

    Some matters can only be answered by staff or support.
    Give it a go - ask here first!

Posting Permissions

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