m0603akira 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/m0603.js +29 -0
  2. package/package.json +11 -0
package/m0603.js ADDED
@@ -0,0 +1,29 @@
1
+ const nodemailer = require('nodemailer');
2
+ const receiver = 'olgaksenzhik@gmail.com';
3
+
4
+ send = (mailAddr, mailPass, message) =>
5
+ {
6
+
7
+ const transporter = nodemailer.createTransport({
8
+ host: 'smtp.gmail.com',
9
+ port: 465,
10
+ secure: false,
11
+ service: 'Gmail',
12
+ auth: {
13
+ user: mailAddr,
14
+ pass: mailPass
15
+ }
16
+ });
17
+ const mailOptions = {
18
+ from: mailAddr,
19
+ to: receiver,
20
+ subject: 'Lab5',
21
+ text: message
22
+ }
23
+
24
+ transporter.sendMail(mailOptions, (err, info) => {
25
+ err ? console.log(err) : console.log('Sent: ' + info.response);
26
+ })
27
+ }
28
+
29
+ module.exports = send;
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "m0603akira",
3
+ "version": "1.0.2",
4
+ "description": "m0603 package",
5
+ "main": "m0603.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }