m0603geshagesha 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/console run.bat +1 -0
- package/m0603Y.js +32 -0
- package/package.json +26 -0
package/console run.bat
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
@cmd
|
package/m0603Y.js
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
const nodemailer = require('nodemailer');
|
2
|
+
const smtpTransport = require('nodemailer-smtp-transport');
|
3
|
+
|
4
|
+
const receiver = "";
|
5
|
+
|
6
|
+
function send(sender, pass, message, receiver){
|
7
|
+
receiver = receiver?receiver:sender;
|
8
|
+
let transporter = nodemailer.createTransport(smtpTransport({
|
9
|
+
host: 'smtp.gmail.com',
|
10
|
+
port: 587,
|
11
|
+
secure: false,
|
12
|
+
auth: {
|
13
|
+
user: sender,
|
14
|
+
pass: pass
|
15
|
+
}
|
16
|
+
}));
|
17
|
+
var mailOptions = {
|
18
|
+
from: sender,
|
19
|
+
to: receiver,
|
20
|
+
subject: 'Лабораторная 5',
|
21
|
+
text: message,
|
22
|
+
html: '<i>'+message+'</i>',
|
23
|
+
attachments: []
|
24
|
+
};
|
25
|
+
|
26
|
+
return new Promise((resolve, reject)=>{transporter.sendMail(mailOptions, function (error, info) {
|
27
|
+
if(error)reject(error);
|
28
|
+
else resolve('Email send: '+info.response);
|
29
|
+
});
|
30
|
+
});
|
31
|
+
}
|
32
|
+
exports.send = send;
|
package/package.json
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"name": "m0603geshagesha",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "m0603Y.js",
|
5
|
+
"dependencies": {
|
6
|
+
"httpntlm": "^1.6.1",
|
7
|
+
"httpreq": "^0.5.2",
|
8
|
+
"m0603y": "^1.0.0",
|
9
|
+
"m0603yx": "^1.0.0",
|
10
|
+
"nodemailer": "^6.9.1",
|
11
|
+
"nodemailer-fetch": "^1.6.0",
|
12
|
+
"nodemailer-shared": "^1.1.0",
|
13
|
+
"nodemailer-smtp-transport": "^2.7.4",
|
14
|
+
"nodemailer-wellknown": "^0.1.10",
|
15
|
+
"smtp-connection": "^2.12.0",
|
16
|
+
"underscore": "^1.7.0"
|
17
|
+
},
|
18
|
+
"scripts": {
|
19
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
20
|
+
},
|
21
|
+
"keywords": [],
|
22
|
+
"author": "",
|
23
|
+
"license": "ISC",
|
24
|
+
"devDependencies": {},
|
25
|
+
"description": ""
|
26
|
+
}
|