Skip to content

dim4k/ExpressMailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExpressMailer

Mailer with reCaptcha validation using ExpressJS

Server requirements

  • NodeJs

Installation

Clone Github repository

git clone https://github.com/dim4k/ExpressMailer.git

Install the dependencies

At the root of your project, run :

npm install

Setup the server

Open conf.json-dist, change this configuration file according to your setup and rename it to conf.json

Run the server

At the root of your project, run :

node server.js

Call to the mailer

Here is a simple example of ajax call to the mailer

$('.submit-form').click(function(){
        var data = $('.form').serializeArray();
        data.push({'name':'userId','value':'yourId'});

        $.ajax({
            data: data,
            type: "POST",
            url: "http://localhost:3000/sendMail",
            success: function(data){
                alert(data.responseDesc);
            },
            error: function (xhr, ajaxOptions, thrownError) {
                console.log(xhr);
            }
        });
});

Assuming the form got the following fields :

  • firstname
  • lastname
  • email
  • message

About

Simple mail sender with reCaptcha validation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published