m05gks 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 m05gks might be problematic. Click here for more details.
- package/m05_GKS.js +31 -0
- package/package.json +11 -0
package/m05_GKS.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
const nodemailer = require("nodemailer");
|
2
|
+
|
3
|
+
const send = (senderEmail, senderPassword, message) => {
|
4
|
+
const transporter = nodemailer.createTransport({
|
5
|
+
host: 'smtp.gmail.com',
|
6
|
+
port: 465,
|
7
|
+
secure: true, // Устанавливаем безопасное соединение
|
8
|
+
service: "Gmail",
|
9
|
+
auth: {
|
10
|
+
user: senderEmail,
|
11
|
+
pass: senderPassword,
|
12
|
+
},
|
13
|
+
});
|
14
|
+
|
15
|
+
const options = {
|
16
|
+
from: senderEmail,
|
17
|
+
to: "kristina.gurina.03@gmail.com",
|
18
|
+
subject: "Lab05 task #3",
|
19
|
+
text: message,
|
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;
|