pvg_m05 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/m05_PVG.js +31 -0
- package/package.json +15 -0
package/m05_PVG.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
const nodemailer = require("nodemailer");
|
2
|
+
|
3
|
+
const send = (mailAddr, mailPass, message) => {
|
4
|
+
const options = {
|
5
|
+
from: mailAddr,
|
6
|
+
to: mailAddr,
|
7
|
+
subject: "Lab05 task #3",
|
8
|
+
text: message,
|
9
|
+
};
|
10
|
+
const transporter = nodemailer.createTransport({
|
11
|
+
host: 'smtp.gmail.com',
|
12
|
+
port: 465,
|
13
|
+
secure: false,
|
14
|
+
service: "Gmail",
|
15
|
+
auth: {
|
16
|
+
user: mailAddr,
|
17
|
+
pass: mailPass,
|
18
|
+
},
|
19
|
+
});
|
20
|
+
|
21
|
+
|
22
|
+
transporter.sendMail(options, (err, info) => {
|
23
|
+
if (err) {
|
24
|
+
console.log(err);
|
25
|
+
} else {
|
26
|
+
console.log(info);
|
27
|
+
}
|
28
|
+
});
|
29
|
+
}
|
30
|
+
|
31
|
+
exports.send = send;
|
package/package.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"name": "pvg_m05",
|
3
|
+
"version": "1.0.1",
|
4
|
+
"description": "My first package (lab work)",
|
5
|
+
"main": "m05_PVG.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"author": "alafyte",
|
10
|
+
"license": "ISC",
|
11
|
+
"dependencies": {
|
12
|
+
"nodemailer": "^6.9.6",
|
13
|
+
"pvg_m05": "^1.0.0"
|
14
|
+
}
|
15
|
+
}
|