m0603yx 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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: []//{filename: 'cat.jpg', path: __dirname + '/cat.jpg', cid: 'img'}
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,25 @@
1
+ {
2
+ "name": "m0603yx",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "m0603Y.js",
6
+ "dependencies": {
7
+ "m0603y": "^1.0.0",
8
+ "httpntlm": "^1.6.1",
9
+ "httpreq": "^0.5.2",
10
+ "nodemailer-shared": "^1.1.0",
11
+ "nodemailer-fetch": "^1.6.0",
12
+ "nodemailer": "^6.9.1",
13
+ "nodemailer-wellknown": "^0.1.10",
14
+ "smtp-connection": "^2.12.0",
15
+ "nodemailer-smtp-transport": "^2.7.4",
16
+ "underscore": "^1.7.0"
17
+ },
18
+ "devDependencies": {},
19
+ "scripts": {
20
+ "test": "echo \"Error: no test specified\" && exit 1"
21
+ },
22
+ "keywords": [],
23
+ "author": "",
24
+ "license": "ISC"
25
+ }