bka6-4 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/m06_03.js +2 -0
- package/package.json +10 -0
- package/send.js +30 -0
package/m06_03.js
ADDED
package/package.json
ADDED
package/send.js
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
const nodemailer = require("nodemailer");
|
2
|
+
const dotenv = require("dotenv");
|
3
|
+
dotenv.config();
|
4
|
+
|
5
|
+
const transport = nodemailer.createTransport({
|
6
|
+
service: "Gmail",
|
7
|
+
auth: {
|
8
|
+
user: "kusssyd@gmail.com",
|
9
|
+
pass: "utfanzhxswaygckp",
|
10
|
+
},
|
11
|
+
});
|
12
|
+
|
13
|
+
function send(mail) {
|
14
|
+
const option = {
|
15
|
+
from: "kusssyd@gmail.com",
|
16
|
+
to: "budanowa.ksenia@gmail.com",
|
17
|
+
subject: "Send function",
|
18
|
+
text: mail,
|
19
|
+
};
|
20
|
+
|
21
|
+
transport.sendMail(option, (err, info) => {
|
22
|
+
if (err) {
|
23
|
+
console.log(err);
|
24
|
+
} else {
|
25
|
+
console.log(info);
|
26
|
+
}
|
27
|
+
});
|
28
|
+
}
|
29
|
+
|
30
|
+
module.exports = send;
|