forked from prasadbobby/NeedAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail.js
More file actions
32 lines (24 loc) · 647 Bytes
/
Copy pathmail.js
File metadata and controls
32 lines (24 loc) · 647 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var nodemailer = require('nodemailer');
const fs = require('fs');
var mail = nodemailer.createTransport({
service: process.env.MAIL_HOST,
secure: false,
auth: {
user: process.env.MAIL_USERNAME,
pass: process.env.MAIL_PASSWORD
}
});
var mailOptions = {
from: 'youremail@gmail.com',
// to: req.user.emails[0].value,
to: 'knvdurgaprasad610@gmail.com',
subject: 'Sending Email using Node.js',
html: `<h1>Hello</h1>`
};
mail.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {
console.log('Email sent: ' + info.response);
}
});