From 82c5bffac4531207955a5e219ae5d59c6bdb63d6 Mon Sep 17 00:00:00 2001 From: Zack Schuster Date: Fri, 3 Sep 2021 15:22:47 -0700 Subject: [PATCH] chore: add example to readme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 2d28327..e660122 100644 --- a/README.md +++ b/README.md @@ -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