Email SDK
Adapters

AWS SES

Send through the SES v2 SendEmail API with built-in SigV4 signing and no AWS SDK dependency.

Capabilities

Repeated headersIdempotencySchedulingPersonalized
YesnoneNoexpanded

These values come from the adapter's exported capabilities declaration. The field support matrix covers normalized message fields.

The SES adapter calls the SES v2 SendEmail API with plain fetch and implements AWS Signature V4 signing itself, so your bundle does not pull in the AWS SDK. Pick a region, optionally a configuration set, and send.

AWS SES logo
AWS SES@opencoredev/email-sdk/ses
Provider docs

Configure

Use credentials allowed to call SES v2 SendEmail in your region, and verify the sender identity in that same region. New AWS accounts start in the SES sandbox, which limits recipients to verified addresses.

lib/email.ts
import { createEmailClient } from "@opencoredev/email-sdk";
import { ses } from "@opencoredev/email-sdk/ses";

export const email = createEmailClient({
  adapters: [
    ses({
      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
      region: process.env.AWS_REGION!,
    }),
  ],
});

Prop

Type

Send

SES maps cc, bcc, replyTo, headers, attachments, and tags (as SES EmailTags, which flow to configuration-set event destinations).

const result = await email.send({
  from: "Acme <billing@acme.com>",
  to: "user@example.com",
  replyTo: "support@example.com",
  subject: "Your May invoice",
  html: "<p>Your invoice for May is ready.</p>",
  tags: [{ name: "type", value: "invoice" }],
});

console.log(result.id); // SES MessageId

No metadata field

SES v2 SendEmail has no metadata concept, so metadata on a message throws an EmailValidationError before any request is made. Use tags instead, or pick a metadata-capable adapter.

Verify from the CLI

AWS_ACCESS_KEY_ID="..." AWS_SECRET_ACCESS_KEY="..." AWS_REGION="us-east-1" \
  npx email-sdk doctor --adapter ses
npx email-sdk send \
  --adapter ses \
  --access-key-id "$AWS_ACCESS_KEY_ID" \
  --secret-access-key "$AWS_SECRET_ACCESS_KEY" \
  --region us-east-1 \
  --from "Acme <hello@acme.com>" \
  --to user@example.com \
  --subject "SES smoke test" \
  --text "It works" \
  --dry-run

--session-token and --configuration-set flags are also available. Drop --dry-run for one real send. It is the only way to prove the identity is verified and the account is out of the SES sandbox.

Compare AWS SES with other providers

Side-by-side message-field support from the SDK capability matrix, with working code for both adapters:

On this page