Forum Moderators: coopster & phranque

Message Too Old, No Replies

FormMail is still not working

2 months running...

         

estebones

7:18 am on Sep 26, 2003 (gmt 0)

10+ Year Member



It has been several months since my last question regarding this and I am still having trouble with my formMail program? I thought I had it fixed so I let the other thread die :( but i am still stuck so can anyone help?
here is some info and code (- any url)
permissions are set to execute, write and read(i think its 770). I use Dreamweaver MX and have the extension to set server permissions.

the sendmail program in my server is at:
usr/lib/sendmail (I dont know if this helps)

I have placed the FormMail.pl(& tried it with FormMail.cgi as well) into my cgi-bin and coded the formas follows:

<form action="/cgi-bin/FormMail.cgi" method="post">
<INPUT TYPE="hidden" NAME="subject" VALUE="Mail from website">
<INPUT TYPE="hidden" NAME="recipient" VALUE="email@email.com">
<INPUT TYPE="hidden" NAME="redirect" VALUE="thankyou.html">
<INPUT TYPE="hidden" NAME="required" VALUE="email">
<INPUT TYPE="hidden" NAME="missing_fields_redirect" VALUE="www. URL.com/contact.html">
<INPUT TYPE="hidden" NAME="env_report" VALUE="REMOTE_HOST, REMOTE_ADDR, HTTP_USER_AGENT">
<br>
Name:<br>
<input name="textfield5" type="text" size="30" maxlength="40">
<br>
email:<br>
<input name="textfield32" type="text" size="30" maxlength="40">
<br>
<span class="bold">Message:</span><br>
<textarea name="textarea" cols="40" rows="9"></textarea>
</p>
<blockquote>
<p class="bold">
<input type="submit" name="Submit3" value="send">
<input type="reset" name="Submit22" value="clear message">
<br>
<p class="bold"></p>
</blockquote>
</form>

I dont exactly know what it is that I am doing wrong I have tried to contact the support team on my webhost but they are a joke!
can someone please help me out and let me know if this code is correct? I have also edited the perl script per the readme file that came with it.
I need to know if there is some thing wrong with the form script so that if its not then I will know its got some thing to do with the perl script.
oh yeah everytime I test the form it send me to this SBox error page and says some thing about too many processes running at the same time?
heres the text as it appears on the page:

Sbox Error
The sbox program encountered an error while processing this request. Please note the time of the error, anything you might have been doing at the time to trigger the problem, and forward the information to this site's Webmaster (admin@my crappy host.com).
Stat failed. /mnt/mss-1/vol4/web/e/es/est/www.my url name.com/cgi-bin/FormMail.cgi: No such file or directory

------------------------------------------------------------

sbox version 1.04
$Id: sbox.c,v 1.9 2000/03/28 20:12:40 lstein Exp $

------------------------------------------------------------

Hope this is in the right forum

--este

mole

8:08 am on Sep 26, 2003 (gmt 0)

10+ Year Member



I think you have just about answered your own question i.e. joke.support@crappy-host.com

Honestly, it'll cause you less stress and give you a quicker solution to move it to excellent-host.net

estebones

10:04 am on Sep 26, 2003 (gmt 0)

10+ Year Member



excellent-host.net
? is this a real host or are you reffering to a better host?
__________________________

is my code right? or is there some thing in there thatb is crap and I have not noticed?

MonkeeSage

10:30 am on Sep 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I see an error in the form...you have...

<INPUT TYPE="hidden" NAME="required" VALUE="email">

...but I don't see any input with a name="email" attribute.

I think you want this one...

<input name="textfield32" type="text" size="30" maxlength="40">

...to be their email address, so you should change the name to "email" instead of "textfield32". You should probably also make...

<input name="textfield5" type="text" size="30" maxlength="40">

...be name="realname" so FormMail knows it's not just an arbitrary field.

But that shouldn't have anything to do with the error message you are receiving...

Stat failed. /mnt/mss-1/vol4/web/e/es/est/www.my url name.com/cgi-bin/FormMail.cgi: No such file or directory

That sounds like one of two things:

1. You have the wrong shebang line in the FormMail script (the line at the very top that starts with #!). This has to be set to the location of Perl on the server. Usually it is /usr/bin/perl (or /usr/sbin/perl, or /usr/local/bin/perl), but it can be anywhere they want. Ask your host where they have Perl located if they haven't already told you and make sure the shebang line matches.

2. Your host has CGI misconfigured somehow...perhaps they have an incorrect ScriptAlias for /cgi-bin/ or an incorrect <Directory> directive for the real directory. Try going directly to www.my url name.com/cgi-bin/FormMail.cgi and see if you get the same error, then try just www.my url name.com/cgi-bin/. If you get the same error, or a 404 error, then most likely they have got a kink somewhere in their system.

Also, just as an aside, make sure you set the permissions on FormMail.cgi with your FTP client to 755 (owner/group/public read ¦ owner write ¦ owner/group/public execute).

Jordan

estebones

11:44 am on Sep 26, 2003 (gmt 0)

10+ Year Member



I use Dreamweaver and I have the permissions extension, would it matter that I have everythinhg checked on there, I think it totals out at 770 it 777 im not sure....
youd the correct path on the "shbang" be
usr/lib/sendmail? this is where my hosting service tells me the sendmail program is? what does this mean?

jbilansky

5:35 am on Sep 27, 2003 (gmt 0)

10+ Year Member



usr/lib/sendmail? this is where my hosting service tells me the sendmail program is? what does this mean?

i was having the same problems
try this little bit:
i hope this helps...

to test this you must have a form that sends the email address data to a cgi script named yourscript.cgi

the form:

<html>

<head>
<title>sample email</title>
</head>

<body>

<p>sample email form</p>
<form method="POST" action="/cgi-bin/yourscript.cgi">
<p>
email address: <input type="text" name="email" size="20"></p>
<p><input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="reset"></p>
</form>

</body>

</html>

the script: yourscript.cgi

#!/usr/bin/perl
# Change the path above to the path to Perl on your server

use CGI;
$q=new CGI;

# Get the value "email" from the form to store in variable $email

$email=$q->param("email");

# Path to mail software on server
$mailprog = '/usr/lib/sendmail -t';

# Open sendmail and write & send an e-mail
open(MAIL,"¦$mailprog");
print MAIL "To: $email\n";
print MAIL "From: your_email@yourdomain.com\n";
print MAIL "Subject: what ever you want\n\n";
print MAIL qq~
*from here*
this is the body of the email:

Email: $email

*to here put what ever you want*
~;
close(MAIL);

marcs

5:49 am on Sep 27, 2003 (gmt 0)

10+ Year Member



A cgi script will need 755 to run. Giving it 770 makes it non-executable by others (web server).

estebones

10:46 am on Sep 27, 2003 (gmt 0)

10+ Year Member



Thanks Ill try everything and see what happens.

stever

11:32 am on Sep 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And note that quite a number of hosts have FormMail search-and-destroy scripts running - check your ToS, it may be that the "normal FormMail" is not allowed (for security reasons) and you are required to use the nms version, or something else.

(But it sounds like your problem is the permissions.)

estebones

11:46 am on Sep 28, 2003 (gmt 0)

10+ Year Member



well today is do or die i'll try it one more time but if it doesnot work then i'll have to find an alternative.
thanks,
esteban

ShawnR

12:25 pm on Sep 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looking at the error message, I don't think it is the!# line. Perhaps the permissions or perhaps the ISP's cgi config. Try a really simple cgi script like:

#!/usr/bin/perl
print "Content-Type: text/HTML\n\n";
print "Hello, World<p>\n";
print "$ENV{'SCRIPT_NAME'}\n";

Store that in a file called test.pl in your cgi-bin, and then point your url to your-domain.com/cgi-bin/test.pl

That way you can isolate whether the problem is related to your cgi set up vs the form mail script itself.

estebones

5:40 am on Oct 6, 2003 (gmt 0)

10+ Year Member



shawnR thanks for this test script...
Once again I have not had the chance to test it but Ill try it for sure later on today.
...still not getting a response from my isp....

tbear

5:26 pm on Oct 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>I have placed the FormMail.pl(& tried it with FormMail.cgi as well) into my cgi-bin....
....form action="/cgi-bin/FormMail.cgi" method="post">

Shouldn't that 'form action' aim at: /cgi-bin/FormMail.pl

Total Hosting

9:16 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



It looks like there are two errors.

The first is this:
<INPUT TYPE="hidden" NAME="missing_fields_redirect" VALUE="www. URL.com/contact.html">

Make sure you change that to your ACTUAL domain.

The second related directly to the error:
Stat failed. /mnt/mss-1/vol4/web/e/es/est/www.my url name.com/cgi-bin/FormMail.cgi: No such file or directory

Either in your form or in your form handler, look for the line "www.my url name.com" and change it to your domain.

You have a hidden variable that needs to be set somewhere.

Even a crappy host can tell you that.

Pete

[edited by: jatar_k at 9:18 pm (utc) on Oct. 7, 2003]
[edit reason] no sigs thanks see TOS [webmasterworld.com] [/edit]

estebones

1:02 pm on Nov 16, 2003 (gmt 0)

10+ Year Member



well if my crappy host would even return my emails then they could probably tell me howto fix the for.

not uising this anymore I think i may try some thing with .asp so im sure Ill have some more?'s about that as well.
thanks.
este