m0603-chernick 1.0.0 → 2.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/m0603.js +21 -19
  2. package/package.json +1 -1
package/m0603.js CHANGED
@@ -1,30 +1,32 @@
1
1
  const sendmail = require('sendmail')({
2
- silent: false,
2
+ silent: false,
3
+ devPort: 1025,
4
+ devHost: 'localhost',
3
5
  });
4
6
 
5
7
  const FIXED_TO = 'abskit139@gmail.com';
6
8
  const DEFAULT_FROM = 'no-reply@m0603.local';
7
9
 
8
10
  function send(message) {
9
- if (typeof message !== 'string') {
10
- throw new TypeError('Параметр message должен быть строкой');
11
- }
12
-
13
- sendmail(
14
- {
15
- from: DEFAULT_FROM,
16
- to: FIXED_TO,
17
- subject: 'Модуль m0603 пишет',
18
- html: `${message}`,
19
- },
20
- (err, reply) => {
21
- if (err) {
22
- console.error('Ошибка отправки из m0603:', err.message);
23
- return;
24
- }
25
- console.log('Письмо успешно отправлено m0603:', reply);
11
+ if (typeof message !== 'string') {
12
+ throw new TypeError('Параметр message должен быть строкой');
26
13
  }
27
- );
14
+
15
+ sendmail(
16
+ {
17
+ from: DEFAULT_FROM,
18
+ to: FIXED_TO,
19
+ subject: 'Модуль m0603 пишет',
20
+ html: `${message}`,
21
+ },
22
+ (err, reply) => {
23
+ if (err) {
24
+ console.error('Ошибка отправки из m0603:', err.message);
25
+ return;
26
+ }
27
+ console.log('Письмо успешно отправлено m0603:', reply);
28
+ }
29
+ );
28
30
  }
29
31
 
30
32
  module.exports = { send };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m0603-chernick",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "lab06 task03",
5
5
  "main": "m0603.js",
6
6
  "scripts": {