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.
- package/m06-03.js +4 -0
- package/package.json +11 -0
- package/send.js +29 -0
package/m06-03.js
ADDED
package/package.json
ADDED
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;
|