bka6-4 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/m06_03.js +2 -0
  2. package/package.json +10 -0
  3. package/send.js +30 -0
package/m06_03.js ADDED
@@ -0,0 +1,2 @@
1
+ const send = require("./send");
2
+ send("hello!");
package/package.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "bka6-4",
3
+ "version": "1.0.0",
4
+ "dependencies": {
5
+ "dotenv": "^16.0.2",
6
+ "bka6-4": "^1.0.1",
7
+ "nodemailer": "^6.7.8",
8
+ "sendmail": "^1.6.1"
9
+ }
10
+ }
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;