m603kir 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of m603kir might be problematic. Click here for more details.
- package/m603module.js +29 -0
- package/package.json +16 -0
package/m603module.js
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
const nodemailer = require('nodemailer');
|
2
|
+
const smtpTransport = require('nodemailer-smtp-transport');
|
3
|
+
|
4
|
+
let sender = 'kirill2402222@gmail.com';
|
5
|
+
let receiver = 'kirill2402222@gmail.com';
|
6
|
+
|
7
|
+
module.exports.send = function (message) {
|
8
|
+
let transporter = nodemailer.createTransport(smtpTransport({
|
9
|
+
host: 'smtp.gmail.com',
|
10
|
+
port: 465,
|
11
|
+
service: 'gmail',
|
12
|
+
secure: false,
|
13
|
+
auth: {
|
14
|
+
user: sender,
|
15
|
+
pass: 'ddnfpzjvwfiojwck'
|
16
|
+
}
|
17
|
+
}));
|
18
|
+
|
19
|
+
var mailOptions = {
|
20
|
+
from: sender,
|
21
|
+
to: receiver,
|
22
|
+
subject: 'LR_06',
|
23
|
+
text: `Message info:${new Date().toLocaleString()}\nMessage:\n${message}`
|
24
|
+
};
|
25
|
+
|
26
|
+
transporter.sendMail(mailOptions, function (error, info) {
|
27
|
+
error ? console.log(error) : console.log('Email sent: ' + info.response);
|
28
|
+
})
|
29
|
+
};
|
package/package.json
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"name": "m603kir",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "LR_06 Node.js",
|
5
|
+
"main": "m603module.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"author": "Kir (kirill2402222@mail.ru)",
|
10
|
+
"license": "ISC",
|
11
|
+
"dependencies": {
|
12
|
+
"nodemailer": "^6.6.5",
|
13
|
+
"nodemailer-smtp-transport": "^2.7.4"
|
14
|
+
},
|
15
|
+
"devDependencies": {}
|
16
|
+
}
|