We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

'form to email'

Does anyone know an easy way to add 'form to email' to a website (not using Wordpress)? The code should preferably be free, easy to edit, include captcha if possible and have no limit on the number of emails per month. A lot to ask I suppose.

Advice would be much appreciated.

Comments

  • UncleZen
    UncleZen Posts: 874 Forumite
    Part of the Furniture 500 Posts Name Dropper Photogenic
    What backend technology do you have; php, perl etc
  • bingo_bango
    bingo_bango Posts: 2,594 Forumite
    I use php to do this. Very easy to configure a script, and it isn't limited (although I'm a little worried by what that means??). Do you have hosting with mailboxes, or do you want a complete email solution to go along with the form?

    Captcha is available as a free script from http://captcha.net
  • kwikbreaks
    kwikbreaks Posts: 9,187 Forumite
    Mail forms are one of the most frequent targets for script kiddies and spammers that there are. You are also dependent on the person completing the form correctly entering their email address and even with some validation and requiring it to be entered twice people still get that wrong.

    If your hosting permits the use of Apache mod rewrite you can get away with using an obscured form of the mailto: link which uses the senders email client so is safe from spambots and guarantees a good return address.

    Create a directory called mail and pop a .htaccess file in there containing
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /

    # With subject - mail/domain/com/user/subject
    RewriteCond %{REQUEST_URI} ^/mail/(.*)/(.*)/(.*)/(.*)$
    RewriteRule ^.* mailto:%3@%1.%2?subject=%4 [R,L]

    # No subject - mail/domain/com/user
    RewriteCond %{REQUEST_URI} ^/mail/(.*)/(.*)/(.*)$
    RewriteRule ^.* mailto:%3@%1.%2 [R]

    A link constructed per examples shown in the comments will kick off the visitors email client with the recipient (you) and optionally the subject pre-completed.

    I'm not sure how many hosts allow this though....
  • Phyllis
    Phyllis Posts: 163 Forumite
    UncleZen wrote: »
    What backend technology do you have; php, perl etc

    Yes, I've got php and perl as here:

    http://www.qiq.co.uk/qiq3uk.php

    I've tried to install QiQ's built in CGI form but haven't been able to edit this or get it to work.

    Simple instructions would be much appreciated.
  • steve1980
    steve1980 Posts: 2,334 Forumite
    Estate Agent, Web Designer & All Round Geek!
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 352.5K Banking & Borrowing
  • 253.7K Reduce Debt & Boost Income
  • 454.5K Spending & Discounts
  • 245.5K Work, Benefits & Business
  • 601.4K Mortgages, Homes & Bills
  • 177.6K Life & Family
  • 259.4K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.