chore: add example to readme

This commit is contained in:
Zack Schuster 2021-09-03 15:22:47 -07:00
parent 4374122320
commit 82c5bffac4
1 changed files with 15 additions and 0 deletions

View File

@ -262,6 +262,21 @@ const options = {
};
```
## Message#checkValidity()
Synchronously validate that a Message is properly formed.
```js
const message = new Message(options);
const { isValid, validationError } = message.checkValidity();
if (isValid) {
// ...
} else {
// first error encountered
console.error(validationError);
}
```
## new SMTPConnection(options={})
```js