emailjs 3.3.0 → 3.7.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/CHANGELOG.md CHANGED
@@ -4,7 +4,39 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [3.3.0] - TBD
7
+ ## [3.6.1] - TBD
8
+ ### Fixed
9
+ - remove call to deprecated `RegExp.prototype.compile` (causes build error on typescript@4.5)
10
+
11
+ ## [3.6.0] - 2021-09-03
12
+ ### Added
13
+ - support `tsc` compilation without `--esModuleInterop` or `--allowSyntheticDefaultImports` [#296](https://github.com/eleith/emailjs/pull/296)
14
+ - `Message#readAsync` API [#297](https://github.com/eleith/emailjs/pull/297)
15
+ - `Message#checkValidity` API [#298](https://github.com/eleith/emailjs/pull/298)
16
+
17
+ ### Deprecated
18
+ - `Message#valid` API [#298](https://github.com/eleith/emailjs/pull/298)
19
+
20
+ ## [3.5.0] - 2021-06-28
21
+ ### Added
22
+ - support `tsc --noPropertyAccessFromIndexSignature` [#290](https://github.com/eleith/emailjs/pull/290)
23
+
24
+ ### Fixed
25
+ - use `engines` field in `package.json` to signal node version support
26
+
27
+ ## [3.4.0] - 2020-12-01
28
+ ### Added
29
+ - `SMTPClient#sendAsync` API [#267](https://github.com/eleith/emailjs/issues/267)
30
+ - `isRFC2822Date` API
31
+
32
+ ### Changed
33
+ - use `WeakSet` instead of `WeakMap` for greylist tracking
34
+
35
+ ### Fixed
36
+ - use camelCase style for internal function names
37
+ - use correct types in jsdoc comments
38
+
39
+ ## [3.3.0] - 2020-08-08
8
40
  ### Added
9
41
  - greylist support [#202](https://github.com/eleith/emailjs/issues/202)
10
42
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # emailjs [![Test Status](https://github.com/eleith/emailjs/workflows/.github/workflows/test.yml/badge.svg)](https://github.com/eleith/emailjs/actions?query=workflow%3A.github%2Fworkflows%2Ftest.yml)
1
+ # emailjs [![Test Status](https://github.com/eleith/emailjs/workflows/.github/workflows/test.yml/badge.svg)](https://github.com/eleith/emailjs/actions?query=workflow%3A.github%2Fworkflows%2Ftest.yml) [![Lint Status](https://github.com/eleith/emailjs/workflows/.github/workflows/lint.yml/badge.svg)](https://github.com/eleith/emailjs/actions?query=workflow%3A.github%2Fworkflows%2Flint.yml)
2
2
 
3
3
  send emails, html and attachments (files, streams and strings) from node.js to any smtp server
4
4
 
@@ -49,6 +49,33 @@ client.send(
49
49
  );
50
50
  ```
51
51
 
52
+ ## EXAMPLE USAGE - using async/await
53
+
54
+ ```js
55
+ // assuming top-level await for brevity
56
+ import { SMTPClient } from 'emailjs';
57
+
58
+ const client = new SMTPClient({
59
+ user: 'user',
60
+ password: 'password',
61
+ host: 'smtp.your-email.com',
62
+ ssl: true,
63
+ });
64
+
65
+ try {
66
+ const message = await client.sendAsync({
67
+ text: 'i hope this works',
68
+ from: 'you <username@your-email.com>',
69
+ to: 'someone <someone@your-email.com>, another <another@your-email.com>',
70
+ cc: 'else <else@your-email.com>',
71
+ subject: 'testing emailjs',
72
+ });
73
+ console.log(message);
74
+ } catch (err) {
75
+ console.error(err);
76
+ }
77
+ ```
78
+
52
79
  ## EXAMPLE USAGE - html emails and attachments
53
80
 
54
81
  ```js
@@ -235,6 +262,21 @@ const options = {
235
262
  };
236
263
  ```
237
264
 
265
+ ## Message#checkValidity()
266
+
267
+ Synchronously validate that a Message is properly formed.
268
+
269
+ ```js
270
+ const message = new Message(options);
271
+ const { isValid, validationError } = message.checkValidity();
272
+ if (isValid) {
273
+ // ...
274
+ } else {
275
+ // first error encountered
276
+ console.error(validationError);
277
+ }
278
+ ```
279
+
238
280
  ## new SMTPConnection(options={})
239
281
 
240
282
  ```js
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "emailjs",
3
3
  "description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server",
4
- "version": "3.3.0",
4
+ "version": "3.7.0",
5
5
  "author": "eleith",
6
6
  "contributors": [
7
7
  "izuzak",
@@ -16,27 +16,31 @@
16
16
  },
17
17
  "type": "module",
18
18
  "devDependencies": {
19
- "@ledge/configs": "23.0.0",
20
- "@rollup/plugin-typescript": "5.0.2",
21
- "@types/mailparser": "2.7.3",
22
- "@types/smtp-server": "3.5.4",
23
- "@typescript-eslint/eslint-plugin": "3.7.1",
24
- "@typescript-eslint/parser": "3.7.1",
25
- "ava": "3.11.0",
26
- "eslint": "7.5.0",
27
- "eslint-config-prettier": "6.11.0",
28
- "eslint-plugin-prettier": "3.1.4",
29
- "mailparser": "2.8.0",
30
- "prettier": "2.0.5",
31
- "rollup": "2.23.0",
32
- "smtp-server": "3.7.0",
33
- "ts-node": "8.10.2",
34
- "tslib": "2.0.0",
35
- "typescript": "3.9.7"
19
+ "@ledge/configs": "23.3.23322",
20
+ "@rollup/plugin-typescript": "8.3.0",
21
+ "@types/mailparser": "3.4.0",
22
+ "@types/node": "16.11.9",
23
+ "@types/smtp-server": "3.5.7",
24
+ "@typescript-eslint/eslint-plugin": "5.4.0",
25
+ "@typescript-eslint/parser": "5.4.0",
26
+ "ava": "3.15.0",
27
+ "eslint": "7.32.0",
28
+ "eslint-config-prettier": "8.3.0",
29
+ "eslint-plugin-prettier": "4.0.0",
30
+ "mailparser": "3.4.0",
31
+ "prettier": "2.4.1",
32
+ "rollup": "2.60.0",
33
+ "smtp-server": "3.9.0",
34
+ "ts-node": "10.4.0",
35
+ "tslib": "2.3.1",
36
+ "typescript": "4.5.2"
37
+ },
38
+ "resolutions": {
39
+ "nodemailer": "6.7.1"
40
+ },
41
+ "engines": {
42
+ "node": ">=10"
36
43
  },
37
- "engine": [
38
- "node >= 10"
39
- ],
40
44
  "files": [
41
45
  "email.ts",
42
46
  "smtp",
@@ -53,7 +57,8 @@
53
57
  "lint": "eslint *.ts \"+(smtp|test)/*.ts\"",
54
58
  "tsc": "tsc",
55
59
  "test": "ava",
56
- "test-cjs": "npm run build && npm run test -- --node-arguments='--title=cjs'"
60
+ "pretest-cjs": "npm run build",
61
+ "test-cjs": "npm run test -- --node-arguments='--title=cjs'"
57
62
  },
58
63
  "license": "MIT"
59
64
  }