Trying to set up Formmail script on my website

  CLONNEN 12:14 05 Dec 04
Locked

Does anyone know exactly how to get formmail.pl 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 04

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


#!/usr/bin/perl
$mailprog = '/usr/sbin/sendmail -oi -t';
@referers = ('speed-mail.co.uk','snow.prohosting.com','click here','click here','localhost','snow.prohosting.com/clonnen','click here','click here');
@recipients = ('speed-mail.co.uk','snow.prohosting.com','click here','click here','localhost','snow.prohosting.com/clonnen','click here','click here','[email protected]');

  CLONNEN 15:55 05 Dec 04

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 'snow.prohosting.com' to your @referers array.


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

  fourjays 16:44 05 Dec 04

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 04

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.

Formmail.pl 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 = ('your-domain-name.com','www . your-domain-name.com','localhost');

@recipients = &fill_recipients('your-domain-name.com','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 formmail.pl 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/FormMail.pl">

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 formmail.pl 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 04

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 04

No prob.

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

Best phone camera 2016/2017: Galaxy S7 vs iPhone 7 vs Google Pixel vs HTC 10 Evo vs OnePlus 3T vs…

1995-2015: How technology has changed the world in 20 years

The Pantone Colour of the Year 2017 is Green

Super Mario Run preview | Hands-on first impressions of Super Mario Run: Mario's iPhone & iPad…