-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail.js
30 lines (28 loc) · 883 Bytes
/
mail.js
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
const nodemailer = require('nodemailer');
module.exports = {
SendMail : function (message){
let transporter = nodemailer.createTransport({
host: 'smtp.webfaction.com',
port: 465,
secure: true,
auth: {
user: 'user',
pass: 'pass'
}
});
// setup email data with unicode symbols
let mailOptions = {
from: '"Linkedin Inv 👻" <mail@mail.com>',
to: 'mail@mail.com,',
subject: 'Test',
text: message,
//html: '<b>Hello world ?</b>' // html body
};
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
}
console.log('Message %s sent: %s', info.messageId, info.response);
});
}
};