kes_06 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/m06_KES.js +26 -0
- package/package.json +14 -0
package/m06_KES.js
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
const nodemailer = require('nodemailer');
|
2
|
+
|
3
|
+
send = (sender, password, message, receiver) =>
|
4
|
+
{
|
5
|
+
|
6
|
+
const mailOptions = {
|
7
|
+
from: sender,
|
8
|
+
to: receiver,
|
9
|
+
text: message
|
10
|
+
}
|
11
|
+
|
12
|
+
const transporter = nodemailer.createTransport({
|
13
|
+
host: 'smtp.mail.ru',
|
14
|
+
port: 587,
|
15
|
+
secure: false,
|
16
|
+
auth: {
|
17
|
+
user: sender,
|
18
|
+
pass: password
|
19
|
+
}
|
20
|
+
});
|
21
|
+
transporter.sendMail(mailOptions, (err, info) => {
|
22
|
+
err ? console.log(err) : console.log('Sent: ' + info.response);
|
23
|
+
})
|
24
|
+
}
|
25
|
+
|
26
|
+
module.exports = send;
|
package/package.json
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"name": "kes_06",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "m06_KES.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"author": "evgen",
|
10
|
+
"license": "ISC",
|
11
|
+
"dependencies": {
|
12
|
+
"nodemailer": "^6.9.7"
|
13
|
+
}
|
14
|
+
}
|