fake-smtp-client
v0.1.2
Published
A TypeScript client for `fake-smtp-server`.
Downloads
254
Maintainers
Readme
fake-smtp-client
A TypeScript client for fake-smtp-server
.
API
getMails(options, filter?)
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: '[email protected]';
from: '[email protected]';
} satisfies Filter;
const magicMails = await getMails(options, filter);
deleteMails(options)
Deletes all mails.
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);