View Full Version : Help Wanted, formmail.pl & dreamweaver, plesk

04-04-2008, 06:49 AM
I have hit a wall here. I can not find any way to make this script work.

I uploaded our new site today to a server running the 'Plesk' framework. I only mention the framework in case anyone is aware of a bug with the formmail script in that environment.

The simple form I created on our website is not sending the user input data to my email as I had hoped it would. I am also getting a 404 page/file not found error.

Can anyone please tell me what I need to modify in my code and in the .pl script to make the form work properly? Also, how do I go about setting up a response page, and how do I set up the syntax for that in the form's html?

I have been at this all night, and would very much appreciate it if someone could help.

Thank you,


HTML of form below:

<form action="../cgi-bin/FormMail.pl" method="post" enctype="text/plain" name="contact" target="_blank" id="contact" dir="ltr" lang="en">
<p class="style11">Chat Live or use the e-mail form below to contact us</p>
<p><span class="style16">Name:</span>
<input name="Name" type="text" id="Name" value="Enter your full name here" size="53" />
<p><span class="style16">e-mail:</span>
<input name="email" type="text" id="email" value="Enter your e-mail address here" size="53" />
<textarea name="comments" cols="48" rows="5" id="comments">Enter your questions, comments or suggestions here and click the 'Submit' button below.

A Web Optimizer representative will contact you via e-mail, usually within 24 hours.</textarea>
<input type="submit" name="submit-button" id="submit-button" value="Submit" />
<input name="recipient" type="hidden" id="recipient" value="contact@websalesopt.com" />

04-04-2008, 08:11 AM
You did not mention what you where getting the 404 on. Also which version of FormMail are you useing? In other words where did you get it? :) There is a version by Matts Scripts (http://www.scriptarchive.com/formmail.html) and then another put out NMS Project (http://nms-cgi.sourceforge.net/scripts.shtml). By the form you posted I assume you are useing the less secure Matt Script version. Have you looked a the ReadMe (http://www.scriptarchive.com/readme/formmail.html) file?

Both programs use the value of "realname" on the form and you are useing "name" at the moment. Not big deal but thought I would mention it if you where expecting the name of the sender to show up in the email header.

They also both use the value of "redirect" on the form to know what page to go to once someone has submitted the form.

<input type="hidden" name="redirect" value="/thankyou.html">

04-04-2008, 06:13 PM
Thanks Shawn,

I am using the formmail.pl from Matt's script archive. It's version 1.92

What I know of these formmail scripts was originally learned via a Total Training Dreamweaver CS3 DVD. The instructor neglected to mention anything about a "redirect" though, and it seems learning this particular bit from the DVD has confused me more than anything.

The 404 was a file not found.. I'm assuming because I have no 'redirect' value assigned, but then I am also not getting any mail to my inbox from the form to begin with.

Is there any way you could suggest what lines I need to change in both my code and my script? Is everything ok except for the 'realname' in the existing code I have? And can I just drop that 'redirect' line of code anywhere into the form html, or does it need to preceed or follow specific lines of code?

Thank you so much for your help. I'll keep trying and report back if I find a solution.


04-05-2008, 07:08 AM
If you are not getting anything from the form then it sounds like you have not configured the script yet. What did you do to "install" the script? You don't have to supply a "redirect" so that would not cause the 404 problem.

I am going to point you to the ReadMe file I linked to above again. Read through it and make sure you have taken all the steps to get the program working correct. Is this the contact page at Web Optimizer? If it is then currently it returns a server error which could mean that permissions where not set on the script.

04-05-2008, 06:37 PM
Hi Shawn,
Yes, this is the contact page at that site.

To install the script, I first edited the formmail.pl file on the recipients and referers lines.

The full relevant (so far as I understand) script portions are as follows:

$mailprog = '/usr/lib/sendmail -i -t';

@referers = ('websalesopt.com');

@recipients = &fill_recipients(contact@websalesopt.com);


That's it.

Apart from that, how do I install a 'redirect' command so it links customers to a 'contact received' page that I will create?

Thanks again for the help, I apreciate it!

04-06-2008, 07:05 AM
Again this is how you "install" a redirect:

<input type="hidden" name="redirect" value="/thankyou.html">
You simply put that in the form and change the value to the webpage you want them to be redirected to. Since you mentioned that this is on an account with Plesk I would assume that you are not a WestHost client or that this domain is not on a WestHost VPS. Have you checked with your hosting company to see if they have any suggestions? Are there other perl scripts on the site that run ok? Is perl installed on the account? Did you change the permissions on the script to 755? Did you upload the script in ASCII mode? Did you make the changes in the script useing a plain text editor. Notepad comes with Windows and be used or you can use and editor like EditPlus or Crimson. Do not use Dreamweaver to edit script files!