m0603rsdpackage 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/m0603.js +37 -0
- package/package.json +15 -0
package/m0603.js
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
const nodemailer = require('nodemailer');
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
const sender = 'belstustudent@gmail.com';
|
6
|
+
const receiver = 'belstustudent@gmail.com';
|
7
|
+
const password = require('D:/unik/pskp/pswrd');
|
8
|
+
|
9
|
+
|
10
|
+
const transporter = nodemailer.createTransport({
|
11
|
+
host: 'smtp.gmail.com',
|
12
|
+
port: 465,
|
13
|
+
secure: false,
|
14
|
+
service: 'Gmail',
|
15
|
+
auth: {
|
16
|
+
user: sender,
|
17
|
+
pass: password
|
18
|
+
}
|
19
|
+
});
|
20
|
+
|
21
|
+
|
22
|
+
send = (message) =>
|
23
|
+
{
|
24
|
+
|
25
|
+
const mailOptions = {
|
26
|
+
from: sender,
|
27
|
+
to: receiver,
|
28
|
+
subject: 'Module m0306',
|
29
|
+
text: message
|
30
|
+
}
|
31
|
+
|
32
|
+
transporter.sendMail(mailOptions, (err, info) => {
|
33
|
+
err ? console.log(err) : console.log('Sent: ' + info.response);
|
34
|
+
})
|
35
|
+
}
|
36
|
+
|
37
|
+
module.exports = send;
|
package/package.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"name": "m0603rsdpackage",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "m0603.js",
|
5
|
+
"scripts": {
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
7
|
+
},
|
8
|
+
"author": "",
|
9
|
+
"license": "ISC",
|
10
|
+
"dependencies": {
|
11
|
+
"nodemailer": "^6.8.0"
|
12
|
+
},
|
13
|
+
"devDependencies": {},
|
14
|
+
"description": ""
|
15
|
+
}
|