Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

CGI Email

Options
  • 29-10-2010 10:19pm
    #1
    Closed Accounts Posts: 27


    Hi,
    really annoying problem here as I have done it right before but can't get it to work now.

    I have a website with a really basic html form that i want to use cgi email script to send to an address

    here's the simple form (form.html):
    <form name="input" action="/cgi-bin/cgiemail/emailformcgi.txt" method="post">
    Name: <input type="text" name="name" /><br><br>
    E-Mail: <input type="text" style="width:200px" name="email" /><br><br>
    Message : <br><textarea cols="40" rows="5" name="comments"></textarea><br>
    <input type="submit" value="Send" />
    </form>
    

    and in the CGI bin on the server, I have a cgi-bin folder, with 4 files:
    cgiecho
    cgiemail
    entropybanner.cgi
    randhtml.cgi
    

    heres the emailformcgi.txt in the public_html folder
    To: myemailaddress@myemail.com                       
    Subject: Contact Us
                                                      
    Name?      [name]
    Email?     [email]           
    Message?   [comments]
    

    I try to use the cgiecho first and it wont work nor will the cgimail work.
    Here is the server error i am getting
    [B]500 Internal Server Error[/B]
    
     The server encountered an internal error or misconfiguration and was unable to complete your request.
     Please contact the server administrator,  webmaster@mysite.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.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5  mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server  at www.mysite.com Port 80
    

    I have not modified anything in the CGI Bin folder
    Can anyone help me out with this one?
    Thanks


Comments

  • Registered Users Posts: 489 ✭✭Pablod


    I'm nowhere near 100% on cgi, but heres my stab in the dark

    you mention the emailformcgi.txt is in the public_html folder

    Two things - should the file not be in the root of your Cgi Bin
    But also, I taught with form processing the action had to point to a .cgi or .pl type file ???

    As I said its a long shot :o


  • Closed Accounts Posts: 27 dazgib


    Pablod wrote: »
    you mention the emailformcgi.txt is in the public_html folder

    Two things - should the file not be in the root of your Cgi Bin
    But also, I taught with form processing the action had to point to a .cgi or .pl type file ???
    Yeah, I tried the emailformcgi.txt in the cgi-bin root but it made no difference.

    On the other point, the form processing action points into the cgiemail cgi script and the emailformcgi.txt in the same line. I'm pretty sure I have that right.
    <form name="input" action="/cgi-bin/cgiemail/emailformcgi.txt" method="post">
    


  • Registered Users Posts: 489 ✭✭Pablod


    Try renaming the emailformcgi.txt to emailformcgi.cgi

    Another option is to try pointing the action to the full address of the cgi file someting like this, might not make much difference, but worth a try.
    <form name="input" action=[URL=" http://www.domainname.com/cgi-bin/cgiemail/emailformcgi.cgi "]www.domainname.com/cgi-bin/cgiemail/emailformcgi.cgi[/URL] method="post">
    

    Your form code looks ok


  • Closed Accounts Posts: 27 dazgib


    I'll give it a go thanks!


  • Registered Users Posts: 6,510 ✭✭✭daymobrew


    What does the server error log say?
    Are you 100% sure that there are no syntax errors in your cgi scripts? Run 'perl -wc' on each one.


  • Advertisement
  • Registered Users Posts: 6,510 ✭✭✭daymobrew


    Can you post the cgiemail and cgiecho scripts here.

    If emailformcgi.txt is the simple text file that you posted, it will not work regardless of the filename extension.

    Where did these files come from? Are there instructions for them somewhere?


  • Closed Accounts Posts: 27 dazgib


    Ok, got it going anyway.

    All i can see that i changed differently was in the first line of the form
    instead of
    <form name="input" action="/cgi-bin/cgiemail/emailformcgi.txt" method="post">
    

    i used
    <form action="http://www.mydomain.com/cgi-bin/cgiemail/emailformcgi.txt" name="input" id="input" method="POST">
    

    I left the emailformcgi.txt in the root folder along with the form.html page.

    @daymobrew
    I never went near the CGI scripts themselves as they're in a binary format and also they were supplied on the server by the hosting company so i presumed they werent the problem. All the instructions were from the CGI email website at M.I.T. It all the instructions for setting it up

    on an side note,
    I also used a hidden/field input in the html form to redirect to a custom success page instead of the very poor generic cgiemail success page.

    Thanks for the replies!

    I must learn PHP :D


Advertisement