m06_gkv 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of m06_gkv might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/m06-03.js +4 -0
  2. package/package.json +11 -0
  3. package/send.js +29 -0
package/m06-03.js ADDED
@@ -0,0 +1,4 @@
1
+ const send = require("./send");
2
+ send("Hello.\n" +
3
+ "I\'ve waited here for you" +
4
+ "\nEverlong");
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "m06_gkv",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "send.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }
package/send.js ADDED
@@ -0,0 +1,29 @@
1
+ const nodemailer = require('nodemailer');
2
+
3
+ const transporter = nodemailer.createTransport({
4
+ host: 'smtp.ethereal.email',
5
+ port: 587,
6
+ auth: {
7
+ user: 'corbin.kuvalis@ethereal.email',
8
+ pass: 'H8gz9Z4drKmvafkQVd'
9
+ }
10
+ });
11
+
12
+ function send(mail) {
13
+ const option = {
14
+ from: "firstMail@example.com",
15
+ to: "secondMail@example.com",
16
+ subject: "Send function",
17
+ text: mail,
18
+ };
19
+
20
+ transporter.sendMail(option, (err, info) => {
21
+ if (err) {
22
+ console.log(err);
23
+ } else {
24
+ console.log(info);
25
+ }
26
+ });
27
+ }
28
+
29
+ module.exports = send;