Giter Site home page Giter Site logo

contact-form's Introduction

contact-form

license

A simple stand-alone web server which implements a contact form on an otherwise static website.

Contains code from Alex Edward's Form Validation blog post which is licensed under the MIT licence.

usage

If you run contact-form in a directory, it will serve up everything in that directory as a static file in the same way a server like nginx or apache would, defaulting to index.html when a "directory" is accessed.

It also sets up a listener on /contact/, which does a few things:

  • You can POST with email, subject, and message to attempt to send an email. This returns a json message {"success": true} on success and {"success": false, "error": "<an error message"} on failure.

  • If there are validation erorrs on particular fields (eg message length, invalid email address, etc.), then those fields will have an error message in the returned json, eg: {"email": "invalid email address"}.

spam control

By default, contact-form will check incoming messages against the postmark spamcheck API. If you do not want this, or it gets discontinued or changed, you can disable this with the -nospam flag or an environ variable.

configuring

You can use the following environment variables to control the way that contact-form behaves and sends email.

CONTACT_PORT        listener http port
CONTACT_NOSPAM      if set, do not check messages for spam
CONTACT_MAILPORT    outgoing mail server port
CONTACT_MAILHOST    outgoing mail server host
CONTACT_MAILUSER    outgoing mail server username
CONTACT_MAILPASS    outgoing mail server passsword
CONTACT_DESTEMAIL   destination email address for messages

contact-form's People

Contributors

jmoiron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.