Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shouraya committed Oct 8, 2020
1 parent eb83951 commit 180575e
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 0 deletions.
35 changes: 35 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
require('dotenv').config();

const nodemailer = require('nodemailer');
// const hbs = require('nodemailer-express-handlebars')

//Step 1

let transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: process.env.EMAIL,
pass: process.env.PASSWORD
}
});

//Step 2

let mailOptions = {
from: '[email protected]',
to: '[email protected], [email protected]',
// cc: ''
// bcc: ''
subject: 'Testing and Testing',
text: 'IT works'
};

//Step 3

transporter.sendMail(mailOptions)
.then(function(response) {
console.log('Email Sent !!');
})
.catch(function(error) {
console.log('Error: ' error);
});
156 changes: 156 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "sending-mail-with-node",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Shouraya/Sending-Mail-with-Node.git"
},
"author": "Shouraya Goyal",
"license": "ISC",
"bugs": {
"url": "https://github.com/Shouraya/Sending-Mail-with-Node/issues"
},
"homepage": "https://github.com/Shouraya/Sending-Mail-with-Node#readme",
"dependencies": {
"dotenv": "^8.2.0",
"nodemailer": "^6.4.13",
"nodemailer-express-handlebars": "^4.0.0"
}
}

0 comments on commit 180575e

Please sign in to comment.