-
Notifications
You must be signed in to change notification settings - Fork 4
Index
siddharthakonakanchi edited this page Dec 5, 2017
·
1 revision
Nodemailer is a module for Node.js applications to allow easy as cake email sending.
npm install uuid
In order to generate a mail with subject line , body and send the forgt password link that contains token of the UUID generated random value
The email is sent from
/users/forgot A mail from noreplygatormeetup@gmail.com is being sent to the user inorder to reset
nodemailer.createTestAccount((err, account) => {
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: "noreplygatormeetup@gmail.com", // generated ethereal user
pass: "gatormeetup" // generated ethereal password
}
});
// setup email data with unicode symbols
const token = uuidv4();
console.log(token);
let mailOptions = {
from: '"Forgot Password" <contact@gatormeetup.com>', // sender address
to: email, // list of receivers
subject: 'Hello ✔', // Subject line
html: user.name + '<br>' +
'<a href="' + SERVER_URL + 'users/reset/' + token + '">Click here to reset password</a>'
No data base operations
More information can be obtained from https://nodemailer.com/about/