Trying to set up Formmail script on my website

  CLONNEN 12:14 05 Dec 2004

Does anyone know exactly how to get working on a website?

Does it need to renamed to formmail.cgi if I am placing it in a cgi-bin folder?

I have tried it with both names and both give me a Access Denied - Bad Referrer message

  CLONNEN 15:34 05 Dec 2004

This is what the first few lines of my formmail.cgi file says at the moment. Can anyone tell me if this is correct? My website address for the form is click here

$mailprog = '/usr/sbin/sendmail -oi -t';
@referers = ('','','click here','click here','localhost','','click here','click here');
@recipients = ('','','click here','click here','localhost','','click here','click here','[email protected]');

  CLONNEN 15:55 05 Dec 2004

This is the message I get when I click on the Submit button on the form.

Bad Referrer - Access Denied
The form attempting to use FormMail resides at click here, which is not allowed to access this cgi script.

If you are attempting to configure FormMail to run with this form, you need to add the following to @referers, explained in detail in the README file.

Add '' to your @referers array.

I have put in the @referrers line and every other variation I can think of.

  fourjays 16:44 05 Dec 2004

I spent ages trying to get formmail up and running on my website. I eventually gave up, and used this instead: click here

  Taran 21:36 05 Dec 2004

In my experience, about 99% of all formmail problems lie in file permssions.

The other 1% are normally due to an incorrect line of code in the script itself, altered by the user. actually only needs a tiny bit of configuring.

The two lines you have to fill in are:

@referers =

@recipients =

They should read something along the lines of:

@referers = ('','www .','localhost');

@recipients = &fill_recipients('','localhost');

You should note that the recipient is mirrored in your permitted referer list.

Aside from that, the only other things you need to get right are the correct path to your sendmail program, which your web host can give you. It should read something like:

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

That's it. You don't need to do anything else to get to work.

Your form should point to the script, by referencing it in its first line, like this:

<form name="form1" id="form1" method="post" action="/cgi-bin/">

And depending on how you want to set things up, you may also need to have a hidden field in it identifying the recipient, like this:

<input name="recipient" type="hidden" value="[email protected]" />

Your cgi-bin and the script should both be CHMOD 775, assuming you are on Apcache hosting.

That's all you need to do.

Two lines in the script, a couple of form fields and a file and folder permission.

Most people run into trouble with the file permission side of things. Some FTP clients show that you have sucessfully altered the CHMOD to 775 when, in fact, you haven't.

Try this link for full destructions on how to set things up.

click here

  CLONNEN 18:17 06 Dec 2004

Couldn't get formmail to work so I tried the Allforms website instead.

Worked first time!

A big thank you to the person who posted the link to their website.

click here

  fourjays 20:12 06 Dec 2004

No prob.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5T review

How to draw a mandala

iPhone X review

Les meilleures enceintes Bluetooth à moins de 150 euros