nk_mod 1.0.0
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.
- package/m0603.js +33 -0
- package/package.json +11 -0
package/m0603.js
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
const nodemailer = require("nodemailer")
|
2
|
+
const nodemailer_smtp_transport = require("nodemailer-smtp-transport")
|
3
|
+
|
4
|
+
let reciever = 'gegiyov492@onlcool.com';
|
5
|
+
|
6
|
+
function send(sender, password, message)
|
7
|
+
{
|
8
|
+
const transporter = nodemailer.createTransport(nodemailer_smtp_transport(
|
9
|
+
{
|
10
|
+
host: "Smtp.mail.ru",
|
11
|
+
port: 465,
|
12
|
+
secure: true, // false with port 587 or 25
|
13
|
+
auth:
|
14
|
+
{
|
15
|
+
user: sender,
|
16
|
+
pass: password
|
17
|
+
}
|
18
|
+
}
|
19
|
+
));
|
20
|
+
|
21
|
+
var mailOptions = {
|
22
|
+
from: sender,
|
23
|
+
to: reciever,
|
24
|
+
text: message
|
25
|
+
}
|
26
|
+
|
27
|
+
transporter.sendMail(mailOptions, function(error, info)
|
28
|
+
{
|
29
|
+
error ? console.log(error) : console.log ('email sent: ' + info.response);
|
30
|
+
})
|
31
|
+
}
|
32
|
+
|
33
|
+
module.exports.send = send;
|