Git Product home page Git Product logo

spcm's Introduction

Simple PHP Contact Mailer

The Simple PHP Contact Mailer works by getting a POST request from the contact form in the contact.html file and then try to figure out if the data is SPAM and then send it along to you via email.

The steps to verify if it is SPAM or not are the following:
  1. See if reCaptcha accepts the request.
  2. See if the IP address has made a request within the threshold.
  3. Sanitise the data a bit.
  4. Send the email to you.

Usage

  1. Make sure that you have a web server with support for PHP and its mail component.
  2. Set up reCaptcha v2 and copy the corresponding keys into mailer.php and contact.html
  3. Change the settings at the top of the mailer.php file to suite your needs.
  4. Upload the mailer.php, contact.html, error_page.html, filter.sqlite and confirmation_page.html to the root of your server, all in the same folder.
  5. Browse to the contact.html file on your server, like example.com/contact.html for example.

Database Set-up

The database file is created with the following statement:

CREATE TABLE `messages` (
    `id`    INTEGER,
    `email` TEXT,
    `name`  TEXT,
    `message`   TEXT,
    `created`   INTEGER,
    PRIMARY KEY(id)
);

CREATE TABLE "spam_fltr" (
    `id`    INTEGER,
    `ip_address`    TEXT(45) UNIQUE,
    `created`   INTEGER,
    PRIMARY KEY(id)
);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.