https://github.com/buschtoens/fake-smtp-client
fake-smtp-client
https://github.com/buschtoens/fake-smtp-client
Last synced: 7 months ago
JSON representation
fake-smtp-client
- Host: GitHub
- URL: https://github.com/buschtoens/fake-smtp-client
- Owner: buschtoens
- Created: 2023-04-21T02:58:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T02:37:17.000Z (almost 2 years ago)
- Last Synced: 2024-04-09T22:23:41.263Z (over 1 year ago)
- Language: TypeScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fake-smtp-client
A TypeScript client for [`fake-smtp-server`][fake-smtp-server].
[fake-smtp-server]: https://github.com/gessnerfl/fake-smtp-server
## API
### `getMails(options, filter?)`
```ts
import {
deleteMails,
type FakeSMTPOptions,
type Filter,
} from 'fake-smtp-client';const options = {
url: 'https://example.org/api/emails',
username: 'hedwig', //optional
password: 'alohomora', // optional
} satisfies FakeSMTPOptions;const allMails = await getMails(options);
const filter = {
since: '1980-07-31T00:00:00Z';
until: '1998-05-2T00:00:00Z';
to: 'h.potter@hogwarts.edu';
from: 'g.weasley@hogwarts.edu';
} satisfies Filter;const magicMails = await getMails(options, filter);
```### `deleteMails(options)`
Deletes all mails.
```ts
import { deleteMails, type FakeSMTPOptions } from 'fake-smtp-client';const options = {
url: 'https://example.org/api/emails',
username: 'hedwig', //optional
password: 'alohomora', // optional
} satisfies FakeSMTPOptions;await deleteMails(options);
```