Skip to content
You're viewing documentation for v0.3.0. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Quickstart

Create a client, send a first transactional email, and verify the CLI path.

Start with the scoped package:

The installed CLI command is named email-sdk. If you only need the CLI for a quick check, run bunx --yes @opencoredev/email-sdk ... instead. See Install for the package and CLI distinction.

Send through Resend

Set RESEND_API_KEY, then create a client with the Resend adapter.

Check the send result

send resolves with the normalized adapter response. The provider value tells you which adapter actually handled the send.

If the adapter returns a message ID, Email SDK exposes it as both id and messageId. Provider responses are still available through raw when an adapter includes them.

Verify from the CLI

Use doctor to check that the selected adapter has the required environment variables.

Use --dry-run to validate the message shape without sending email.

When the package is installed in your project, the same command can run through the installed binary:

Add SMTP fallback

Add SMTP when you want a second route for the same transactional email. The SMTP adapter is built in and does not require Nodemailer. When SMTP auth is configured on a non-secure connection, Email SDK upgrades with STARTTLS before authenticating.

Only use fallback adapters that can send the same message shape. For example, SMTP supports address fields and headers, but not provider-only fields like tags, metadata, or attachments.

Your application still sends the same way:

Last updated on