PDA

View Full Version : email form help


animalssj
12-27-2002, 04:34 AM
I am having some trouble with my FormMail.pl
i have it configured as such;

$mailprog = '!/usr/sbin/sendmail -i -t';
@referers = ('[mydomain.com]','[myipaddress]');
@recipients = ('^webmaster\@mydomain\.com');
@valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT');

it's not working, i have permissions set at 777

this is my code in my webpage too.
so confused


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Subscribe to The Weekly Newsletter!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#000066">
<div align="center">
<form name="form1" method="post" action="cgi-bin/FormMail.pl">
<table width="242" height="86" border="0">
<tr>
<td><p align="left"><font color="#0099FF" face="Arial, Helvetica, sans-serif">Type
your e-mail address here and click submit to receive the weekly newsletter!</font></p>
<p align="left">
<input name="textfield" type="text" value="Enter your e-mail" size="29" maxlength="29">
<input type="submit" name="Submit" value="Submit">
<input type=hidden name="recipient" value="webmaster@mydomain.com">
</p>
<p></p>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp; </p>
</form>
</div>
</body>
</html>

what am i missing?? i feel like im banging my head against a wall.
thanks!

animalssj

Philip M
12-28-2002, 03:35 PM
I suspect that you need to alter

action="cgi-bin/FormMail.pl"

to action ="http://www.yourdomain.com/cgi-bin/formmail.pl"

Note that formmail.pl is case sensitive. It must match the script name exactly.

When you say "It does not work" please can you be more specific.
Does nothing at all happen? Do you receive any sort of error message?

By the way, 29 is not an adequate number of characters for an email address - the other day I had a customer with 38 characters in his address, and I now allow up to 45 on my forms.

I think you may have confused the vertical bar pipe symbol Świth a ! symbol ----

open(MAIL,"|/usr/sbin/sendmail -t");

crackn101
12-29-2002, 05:44 AM
Hi.

I could be wrong here, but i don't think that you should have
the ! in your path to sendmail.

You have : $mailprog = '!/usr/sbin/sendmail -i -t';

Should Be :

$mailprog = '/usr/sbin/sendmail -i -t';
- or -
$mailprog = '/usr/sbin/sendmail -oi -t';

Also check to see that you have the correct path to sendmail.
Here are the most common paths :

/usr/sbin/sendmail
/usr/bin/sendmail
/usr/lib/sendmail

Take Care.
crackn101

stephenc
01-01-2003, 09:40 PM
I know that with my web host, I have to chomod to 755 otherwise it will not work either. I also made the mistake of forgetting to chomod the cgi-bin folder itself.

The other obvious is forgeting to upload it in ASCII.

If you still cant get it working, I have a simple script on my own site which you will get working easily.

Stephen