Skip to content

rezkyfm/nodejs-contact-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Contact Form

Contact form build with Bootstrap and Nodemailer

Demo

Demo Page

Installation

  1. Install the dependencies and start the server.
$ git clone https://github.com/rezkyfm/nodejs-contact-form.git
$ cd nodejs-contact-form
$ npm install && npm start
  1. Open in browser
http://localhost:3000

Configuration

Open config.js

/* 
config.js
*/
module.exports = {
    // Theme
    theme: "lightBlue",

    // Email notifier account (sender)
    host: "smtp.mailtrap.io", // Sender email smtp
    port: "465", // Sender email port
    user: "username", // Sender email username
    pass: "password", // Sender email password

    // Your email to receive notification (receiver)  
    from: '"Contact Me" <[email protected]>', // Sender email address
    to: '[email protected]', // Your email address
    subject: 'Contact Us', // Subject
};

Gmail SMTP Setup

  1. Setup app password for gmail
  2. Open app.js and change
let transporter = nodemailer.createTransport({
        host:  config.host,
        port: config.port,
        secure: false,
        auth: {
                user: config.user,
                pass: config.pass
        },
        tls:{
            rejectUnauthorized:false
        }
});
  1. replace to
let transporter = nodemailer.createTransport(
    `smtps://${config.user}:${config.pass}@smtp.gmail.com`
);

Theme Screenshoot

lightBlue

lightBlue

darkSky

darkSky