Results 1 to 6 of 6

Thread: Matts Script - FormMail - help! (beginner)

  1. #1
    Join Date
    Apr 2008

    Matts Script - FormMail - help! (beginner)

    I've been round and round with the Tech Support with this one. Please keep in mind I've never touched perl/cgi and I'm a beginner and know nothing beyond HTML/CSS...

    I'm trying to set up this script to email me whatever information is entered in my form...that's how it's supposed to work, right?

    I keep getting an INTERNAL SERVER ERROR about Misconfiguration, and I can't figure out what I'm doing wrong.

    I am using:

    on the page:

    I want it to send that information to my email, and then refresh to the page
    http://www.stevedolan.com/contact_thx.html When complete.

    First I figured out that I didn't have it set to chmod 755, now I do...then I was told by support that the "formatting of my file was wrong"

    I've downloaded "Perl Express" since I guess Dreamweaver doesn't edit perl?

    Can someone help me out please? I feel like I've followed the directions to the letter and I have no Idea why I'm coming up with errors.

    Thanks so much for your time and attention.
    Last edited by scribblesteve; 02-24-2009 at 09:11 PM.

  2. #2
    Join Date
    Oct 2007
    Vienna, Austria
    OK, we'll check 1) your FormMail script and 2) if you can run perl at all.

    Ad 1) Please open your FormMail.pl script in notepad or another plain text editor, copy the entire content and paste it here as a reply. Please surround the code in [CODE] ... [/CODE] tags, so the formatting doesn't break.

    I or somebody else will look at the code and see if there are any errors.

    Ad 2) With a plain text editor, create a file named for example "test.pl". Enter into it:
    BEGIN {
        $| = 1;
        print "Content-type: text/html\n\n";
    print "We are running perl version $]\n";
    Upload the file on your server to the same directory where FormMail.pl resides, chmod it to 755 and request the file in your browser (same URL as to FormMail.pl but with test.pl instead).

    Post here what you get (again inside [CODE][/CODE] pls).

    That should give us some insight into what's going wrong.

  3. #3
    Join Date
    Apr 2008


    Ok, here is all I touched on this FormMail.pl script. The actual script is about 2700 lines long, I dont think you need all of that...I've posted below everything I touched:

    #!/usr/bin/perl -wT
    # NMS FormMail Version 3.12c1
    use strict;
    use vars qw(
      $DEBUGGING $emulate_matts_code $secure %more_config
      $allow_empty_ref $max_recipients $mailprog @referers
      @allow_mail_to @recipients %recipient_alias
      @valid_ENV $date_fmt $style $send_confirmation_mail
      $confirmation_text $locale $charset $no_content
      $double_spacing $wrap_text $wrap_style $postmaster
    # -------------------
    # FormMail.pl Version 3.12c1
    # This program is licensed in the same way as Perl
    # itself. You are free to choose between the GNU Public
    # License <http://www.gnu.org/licenses/gpl.html>  or
    # the Artistic License
    # <http://www.perl.com/pub/a/language/misc/Artistic.html>
    # For help on configuration or installation see the
    # README file or the POD documentation at the end of
    # this file.
    # --------------------------
    # Modify these to your own settings. You might have to
    # contact your system administrator if you do not run
    # your own web server. If the purpose of these
    # parameters seems unclear, please see the README file.
      $DEBUGGING         = 0;
      $emulate_matts_code= 0;
      $secure            = 1;
      $allow_empty_ref   = 1;
      $max_recipients    = 2;
      $mailprog          = '/usr/sbin/sendmail -oi -t';
      $postmaster        = 'scribblesteve@gmail.com';
      @referers          = qw(www.stevedolan.com);
      @allow_mail_to     = qw(scribblesteve@gmail.com);
      @recipients        = ();
      %recipient_alias   = ();
      $locale            = '';
      $charset           = 'iso-8859-1';
      $date_fmt          = '%A, %B %d, %Y at %H:%M:%S';
      $style             = 'http://www.stevedolan.com/css/5.css';
      $no_content        = 0;
      $double_spacing    = 1;
      $wrap_text         = 0;
      $wrap_style        = 1;
      $send_confirmation_mail = 0;
      $confirmation_text = <<'END_OF_CONFIRMATION';
    From: me@stevedolan.com
    Subject: My Contact Form
    Thank you for contacting me, I have recieved your submittion and will respond accordingly.  I hope all is well with you and yours.
    # You may need to uncomment the line below and adjust the path.
    # use lib './lib';
    # --------------------------
    # Place any custom code here
    # ----------------------------
    # (no user serviceable parts beyond here)
    # The code below consists of module source inlined into this
    # script to make it a standalone CGI.
    # Inlining performed by NMS inline - see /v2/buildtools/inline
    # in CVS at http://sourceforge.net/projects/nms-cgi for details.
    BEGIN {
    (and the code continues)

    And for the Test.pl thing you had me try, I this is what I got when I requested that page, which happens to be the same exact error I get with this form:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, webmaster@stevedolan.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ Server at www.stevedolan.com Port 80
    I should mention though, that I was in contact with my host Tech Support, and they said that they "fixed" the problem, and I still need to do some configuration -

    When I checked after they fixed it, the submit button processed correctly, but redirected to the incorrect page (no errors), yet I didn't receive any emails. When I attempted (poorly) to correct the problem, I kept ending up with the Internal Server Error.

    I hope that helps in some way. Thanks for your time, I really appreciate it.

  4. #4
    Join Date
    Oct 2007
    Vienna, Austria
    The code you posted seems OK -- but without the whole thing, it's impossible to say what could be wrong.

    The weirder thing is that my testing script ends with server error. I tested it, it should work and print the perl version. Its not working shows that there is really some misconfiguration -- please double check if the execute permissions are set and if you copied the code exactly. If so, then it may be time to ask the tech support again why this minimalistic script is not running. When we get to make that work, we may go on searching for the cause of the formmail malfunction. If not even the minimal script runs OK, nothing bigger likely will.

  5. #5
    Join Date
    Apr 2008

    Red face Here's an Update...

    I've been in contact with my Hosting company tech support - and I got this email back from them:

    There was a syntax error in the FormMail.pl file. 
    sudo -u scribble ./FormMail.pl
    audit_log_user_command(): Connection refused
    Array found where operator expected at ./FormMail.pl line 48, at end of line
    syntax error at ./FormMail.pl line 48, near "scribblesteve@gmail"
    Global symbol "@gmail" requires explicit package name at ./FormMail.pl line 48.
    BEGIN not safe after errors--compilation aborted at ./FormMail.pl line 80.
    Now the form looks like it processes correctly, and ends up at the right landing page - but now - I'm not receiving the information, it's not being emailed properly.

    I thought this was supposed to be a simple, easy script....

    For the interested - here is a link to the entire script - It's too long to post here:
    Last edited by scribblesteve; 02-26-2009 at 10:34 AM.

  6. #6
    Join Date
    Oct 2007
    Vienna, Austria
    The syntax error they report does not fit. There must be something more profound going on. Please, try to make them help you get the minimal test script running -- since it throws an internal server error, there must be an error elsewhere than in the script itself.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.09686 seconds
  • Memory Usage 2,892KB
  • Queries Executed 13 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates