FormMail FAQ

Frequently asked questions about the FormMail CGI script.

Q1: How do I set up FormMail?

Follow these steps to set up FormMail:

  1. Upload the script:
    Upload formmail.pl to /cgi-bin/
  2. Set permissions:
    chmod 755 formmail.pl
  3. Configure allowed recipients:
    @referers = ('yourdomain.com');
    @recipients = ('[email protected]');
  4. Create your HTML form:
    <form action="/cgi-bin/formmail.pl" method="post">
      <input type="hidden" name="recipient" value="[email protected]">
      <input type="hidden" name="subject" value="Contact Form">
      <!-- Your form fields -->
      <input type="submit" value="Send">
    </form>

Q2: Why am I not receiving emails from FormMail?

If you're not receiving emails, check these common issues:

  1. Check spam folder: FormMail emails often get flagged as spam
  2. Verify recipient setting: Ensure the recipient is in the @recipients array
  3. Check referer setting: Your domain must be in @referers
  4. Verify sendmail path: Check that $mailprog is correct:
    $mailprog = '/usr/lib/sendmail -t';
  5. Check server logs: Look for errors in the web server error log
Common Issue: Many hosts block outgoing mail from CGI scripts. Contact your hosting provider to verify mail is enabled.

Q3: The redirect command won't work

Short Answer:

There's a bug in the URL validation code.

Long Answer:

When the code was written, it checks for basic URL syntax before redirecting, ensuring the URL starts with http://. If your URL doesn't start with that, you have two options:

Option 1: Change Your Redirect URL

Make sure your redirect URL starts with http:// or https://

Option 2: Modify the Script

Find line 204 and remove the URL check

To modify the script, find this line (around line 204):

if ($CONFIG{'redirect'} =~ /http\:\/\/.*\..*/) {

Change it to:

if ($CONFIG{'redirect'}) {

This removes the URL validation and allows any URL or URI in the redirect form field.

Back to FAQ