mymodulealinafortask 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/m0603.js +28 -0
  2. package/package.json +11 -0
package/m0603.js ADDED
@@ -0,0 +1,28 @@
1
+ const nodemailer = require('nodemailer');
2
+ const receiver = 'alina.sevryuk0708@gmail.com';
3
+
4
+ function send (mailAddr, mailPass, message)
5
+ {
6
+ const transporter = nodemailer.createTransport({
7
+ host: 'smtp.gmail.com',
8
+ port: 465,
9
+ secure: false,
10
+ service: 'Gmail',
11
+ auth: {
12
+ user: mailAddr,
13
+ pass: mailPass
14
+ }
15
+ });
16
+ const mailOptions = {
17
+ from: mailAddr,
18
+ to: receiver,
19
+ subject: 'hello!!!',
20
+ text: message
21
+ }
22
+
23
+ transporter.sendMail(mailOptions, (err, info) => {
24
+ err ? console.log(err) : console.log('Sent: ' + info.response);
25
+ })
26
+ }
27
+
28
+ module.exports = send;
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "mymodulealinafortask",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "m0603.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }