mirror of https://github.com/eleith/emailjs.git
chore: add example to readme
This commit is contained in:
parent
4374122320
commit
82c5bffac4
15
README.md
15
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
|
||||
|
|
Loading…
Reference in New Issue