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',
password: 'alohomora',
} 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.
import { deleteMails, type FakeSMTPOptions } from 'fake-smtp-client';
const options = {
url: 'https://example.org/api/emails',
username: 'hedwig',
password: 'alohomora',
} satisfies FakeSMTPOptions;
await deleteMails(options);