m0603artphresl 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 = 'art.rusak@mail.ru'
|
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;
|
package/package.json
ADDED