Email SDK
Reference

CLI

Reference for the email-sdk command-line smoke test.

The CLI is intentionally small. Use it to inspect adapters, check environment variables, validate a message with --dry-run, and send a smoke-test email from your terminal.

email-sdk send \
  --adapter resend \
  --from "Acme <hello@acme.com>" \
  --to "user@example.com" \
  --subject "Hello" \
  --text "It works"

Adapters

email-sdk adapters
AdapterRequired environment
resendRESEND_API_KEY
postmarkPOSTMARK_SERVER_TOKEN
sendgridSENDGRID_API_KEY
mailgunMAILGUN_API_KEY, MAILGUN_DOMAIN
mailersendMAILERSEND_API_KEY
brevoBREVO_API_KEY
mailchimpMAILCHIMP_API_KEY
sparkpostSPARKPOST_API_KEY
loopsLOOPS_API_KEY, LOOPS_TRANSACTIONAL_ID
plunkPLUNK_API_KEY
mailtrapMAILTRAP_API_KEY
scalewaySCALEWAY_SECRET_KEY, SCALEWAY_PROJECT_ID
zeptomailZEPTOMAIL_TOKEN
mailpaceMAILPACE_API_KEY
smtpSMTP_HOST, plus SMTP auth variables when needed

If --adapter is omitted, the CLI selects the first adapter with all required environment variables set.

Doctor

email-sdk doctor --adapter resend

doctor checks whether the selected adapter has the required environment variables.

Flags

FlagAdapterNotes
--adapterallAdapter routing name.
--providerallAlias for --adapter.
--fromallSender address.
--toallRecipient address. Comma-separated values are allowed.
--subjectallMessage subject.
--textallPlain text body.
--htmlallHTML body.
--ccsendComma-separated CC addresses.
--bccsendComma-separated BCC addresses.
--reply-tosendComma-separated reply-to addresses.
--headersendHeader in Name: value format. Repeatable.
--tagsendTag in name=value format. Repeatable.
--metadatasendMetadata in key=value format. Repeatable.
--attachmentsendLocal file path, optionally path:content/type.
--messagesendRead an EmailMessage JSON payload from a file.
--dry-runallValidate and print the send plan without sending.
--api-keymanyOverrides the adapter API key variable.
--server-tokenPostmarkOverrides POSTMARK_SERVER_TOKEN.
--message-streamPostmarkOptional message stream.
--domainMailgunOverrides MAILGUN_DOMAIN.
--transactional-idLoopsOverrides LOOPS_TRANSACTIONAL_ID.
--project-idScalewayOverrides SCALEWAY_PROJECT_ID.
--secret-keyScalewayOverrides SCALEWAY_SECRET_KEY.
--tokenZeptoMailOverrides ZEPTOMAIL_TOKEN.
--hostSMTPOverrides SMTP_HOST.
--portSMTPOverrides SMTP_PORT.
--secureSMTPSet to true for secure SMTP.
--require-tlsSMTPRequire STARTTLS.
--allow-insecure-authSMTPAllow SMTP AUTH without TLS.
--userSMTPOverrides SMTP_USER.
--passSMTPOverrides SMTP_PASS.

The CLI prints the normalized adapter response as JSON.

On this page