Contact form build with Bootstrap and Nodemailer
- 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
- Open in browser
http://localhost:3000
Open config.js
/* config.js*/module.exports={// Themetheme: "lightBlue",// Email notifier account (sender)host: "smtp.mailtrap.io",// Sender email smtpport: "465",// Sender email portuser: "username",// Sender email usernamepass: "password",// Sender email password// Your email to receive notification (receiver) from: '"Contact Me" <noreply@example.com>',// Sender email addressto: 'email@example.com',// Your email addresssubject: 'Contact Us',// Subject};- Setup app password for gmail
- Open app.js and change
lettransporter=nodemailer.createTransport({host: config.host,port: config.port,secure: false,auth: {user: config.user,pass: config.pass},tls:{rejectUnauthorized:false}});- replace to
lettransporter=nodemailer.createTransport(`smtps://${config.user}:${config.pass}@smtp.gmail.com`);
