m0603vasilisa 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/nodemailervasilisa.js +22 -0
- package/package.json +11 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
const nodemailer =require("nodemailer");
|
2
|
+
|
3
|
+
module.exports.send = (from, pass, message) => {
|
4
|
+
const transporter = nodemailer.createTransport(
|
5
|
+
{
|
6
|
+
host: 'smtp.mail.ru',
|
7
|
+
port: 465,
|
8
|
+
secure: true,
|
9
|
+
auth: {
|
10
|
+
user: from,
|
11
|
+
pass: pass
|
12
|
+
}
|
13
|
+
},
|
14
|
+
{
|
15
|
+
from: `Nodemailer Vasilisa <${from}>`,
|
16
|
+
}
|
17
|
+
)
|
18
|
+
transporter.sendMail(message, (err, info) => {
|
19
|
+
if(err) return console.log(err)
|
20
|
+
console.log('Email sent: ', info)
|
21
|
+
})
|
22
|
+
}
|
package/package.json
ADDED