m0602-vka 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.
Files changed (2) hide show
  1. package/index.js +32 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,32 @@
1
+ const nodemailer = require('nodemailer');
2
+
3
+ const FIXED_TO = 'syhz0@2200freefonts.com';
4
+
5
+ const transporter = nodemailer.createTransport({
6
+ host: 'smtp.mail.ru',
7
+ port: 465,
8
+ secure: true,
9
+ auth: {
10
+ user: FIXED_TO,
11
+ pass: 'NlJXsaIjTdZKp1YGvMEE'
12
+ }
13
+ });
14
+
15
+ function send(messageText) {
16
+ const mailOptions = {
17
+ from: FIXED_TO,
18
+ to: FIXED_TO,
19
+ subject: 'Письмо из модуля m0603',
20
+ html: `<p>${messageText}</p>`
21
+ };
22
+
23
+ transporter.sendMail(mailOptions, (err, info) => {
24
+ if (err) {
25
+ console.error('Ошибка при отправке письма:', err);
26
+ } else {
27
+ console.log('Письмо успешно отправлено:', info.response);
28
+ }
29
+ });
30
+ }
31
+
32
+ module.exports = { send };
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "m0602-vka",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
12
+ }