m0603-demo2 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 +26 -0
- package/package.json +14 -0
package/m0603.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const nodemailer = require("nodemailer");
|
|
2
|
+
|
|
3
|
+
const Send = async (message) => {
|
|
4
|
+
const transporter = nodemailer.createTransport({
|
|
5
|
+
host: 'smtp.ethereal.email',
|
|
6
|
+
port: 587,
|
|
7
|
+
auth: {
|
|
8
|
+
user: 'marguerite.heidenreich19@ethereal.email',
|
|
9
|
+
pass: 'gecPvZRwzhSq7XSF9N'
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
let info = await transporter.sendMail({
|
|
13
|
+
from: 'marguerite.heidenreich19@ethereal.email', // sender address
|
|
14
|
+
to: "t5p.2a@mail.ru, delta.schmitt13@ethereal.email", // list of receivers
|
|
15
|
+
subject: "Hello ✔", // Subject line
|
|
16
|
+
text: message, // plain text body
|
|
17
|
+
html: `<b>${message}</b>`, // html body
|
|
18
|
+
});
|
|
19
|
+
console.log("Message sent: %s", info.messageId);
|
|
20
|
+
// Message sent: <b658f8ca-6296-ccf4-8306-87d57a0b4321@example.com>
|
|
21
|
+
|
|
22
|
+
// Preview only available when sending through an Ethereal account
|
|
23
|
+
console.log("Preview URL: %s", nodemailer.getTestMessageUrl(info));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
module.exports.send = Send;
|
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "m0603-demo2",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "m0603.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"nodemailer": "^6.8.0"
|
|
13
|
+
}
|
|
14
|
+
}
|