ZapSMTP / Developers

Build email into your stack.

Official SDKs, framework packages, a CLI, and an OpenAPI 3.1 specification. Choose the integration that fits your application.

Official SDKs and framework packages

Every SDK covers the whole API, retries safely with an idempotency key, walks every page of a list, raises typed errors and verifies webhook signatures.

  • Node.js

    Node.js 18+, Bun, Deno

    TypeScript types for every request and response; ESM and CommonJS; no dependencies.

    npm install zapsmtp
    Quickstart GitHub · npm
  • Python

    Python 3.9+

    Sync and async clients, typed models, httpx underneath.

    pip install zapsmtp
    Quickstart GitHub · PyPI
  • PHP

    PHP 8.1+

    PSR-18 HTTP client, Guzzle by default; typed models with array access.

    composer require zapsmtp/zapsmtp-php
    Quickstart GitHub · Packagist
  • Laravel

    Laravel 10, 11, 12

    A mail transport for your Mailables, a facade for the API and verified webhook events.

    composer require zapsmtp/zapsmtp-laravel
    Framework guide GitHub · Packagist
  • Go

    Go 1.23+

    Standard library only; context on every call; range over every page.

    go get github.com/zapsmtp/zapsmtp-go
    Quickstart GitHub · pkg.go.dev
  • Ruby

    Ruby 3.0+

    Standard library only; an ActionMailer delivery method for Rails.

    gem install zapsmtp
    Quickstart GitHub · RubyGems
  • Rails

    Action Mailer delivery method

    Set the delivery method and Action Mailer sends through the API; a Rack middleware verifies webhooks.

    gem "zapsmtp" # Gemfile
    Framework guide
  • Java

    Java 11+

    Builders for every request, immutable models, java.net.http underneath.

    implementation("com.zapsmtp:zapsmtp-java:0.1.0")
    Quickstart GitHub · Maven Central
  • .NET

    .NET 8, .NET Standard 2.0

    Async API with cancellation, dependency injection, IAsyncEnumerable paging.

    dotnet add package ZapSMTP
    Quickstart GitHub · NuGet

Your first template send and webhook check

Send the sign-in code template with its variables, then verify the signature of the webhook that follows: with a test key and a simulator address, an email.delivered event arrives, and the verification returns it as an event object or throws. Same language, both steps.

1. Send a template
import { ZapSMTP } from 'zapsmtp';

const zap = new ZapSMTP(); // reads ZAP_API_KEY, on your server

await zap.emails.send({
  from: 'Halden <security@haldenoutfitters.com>',
  to: 'sofia.marin@example.com',
  template: {
    id: 'sign-in-code',
    variables: {
      name: 'Sofia',
      code: '482 913',
      expires_in: '10 minutes',
      device: 'Safari on iPhone',
      location: 'Portland, US',
      time: '9:41 AM',
    },
  },
});
2. Verify the webhook
import { verifyWebhook } from 'zapsmtp';

// the raw body, before any JSON parsing
const event = verifyWebhook(rawBody, req.headers, process.env.ZAP_WEBHOOK_SECRET);

A zap_test_… key runs the whole pipeline and delivers nothing; the simulator address acts out a delivery. Pass the raw body to the verification, before any JSON parsing. Webhook events

The CLI and the OpenAPI description

The zapsmtp command has a command for every API operation, prints tables in a terminal and JSON when piped, and exits non-zero with the error code and request id.

The whole API is in an OpenAPI 3.1 description: import it into Postman or Insomnia, or generate a client for a language without an SDK. Each operation’s x-sdk-method names the SDK method that calls it.

Shell
npm install -g zapsmtp-cli
zapsmtp login                       # checks the key, keeps it readable by you only
zapsmtp test --from hello@acme.com  # an email to the simulator and the event it will raise
zapsmtp send --from "Acme <hello@acme.com>" --to jane@example.org \
  --subject "Your receipt" --html-file receipt.html --attach ./invoice.pdf
zapsmtp emails list --status bounced --all --json | jq '.data[].to'
zapsmtp domains verify <domain-id>

Coming from another provider

Field and event maps, template conversion, suppression import and a gradual rollout plan, provider by provider. Applications that send over SMTP only change the host and credentials.

Everything else you need

  • AI tools

    The MCP server, Agent Skills, llms.txt and Markdown docs for coding assistants.

    AI tools
  • API reference

    Every endpoint with parameters, responses, errors and examples in nine languages.

    API reference
  • Changelog

    What changed in the API, the dashboard and the SDKs.

    Changelog
  • Security

    Scoped and expiring API keys, signed webhooks and how we handle your data.

    Security
  • Support

    Questions about an integration or a migration.

    Contact us

Send your first email today.

Create a test key and send to the simulator with your SDK or over HTTP.

Start for free Read the docs 3,000 emails/month · 100/day · No credit card required