Build Resend

NOT REALLYreplaces $20/mosaves $240/yrback to the verdict

0%0 of 17 items done

Saved on this device only. Tick prerequisites first, then work the phases in order · do not start one until the checks above it pass.

Not an email provider: deliverability is reputation, not code. This is the mail module that makes the provider replaceable: one interface, an SMTP driver, a hosted-API driver, a dev driver that writes .eml files, DNS records checked, bounces suppressed, and an honest page on self-hosting Postal if you insist.

estimated effort one sittingthe files for this build are in the project pack

RuntimeNode 22Driversnodemailer for SMTP, fetch for a hosted API

Before step 1

Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.

  1. installfree

    Why Everything in this build runs on it: the server, the scripts, the tests.

    Get it Download the LTS installer from nodejs.org, or install with your package manager (brew install node, or nvm install 22). Restart the terminal afterwards. open ↗

    Verify node --version prints v22 or higher

  2. installfree

    Why Every step below is a command you type or a file you edit.

    Get it VS Code (code.visualstudio.com), Cursor or Zed. Open a folder for the project and use the editor's built-in terminal. open ↗

    Verify You can open a folder and run a command in its terminal

  3. installfree

    Why History for your code, and the way most hosts deploy.

    Get it Install from git-scm.com or with your package manager, then run git init in the project folder once it exists. open ↗

    Verify git --version prints a version

  4. free on a domain you own

    Why SPF, DKIM and DMARC records are what make mail deliverable.

    Get it Use a subdomain like mail.yourdomain.com so experiments never hurt your main domain's reputation.

  5. API keyfree tier; then usage-based

    Why The hosted driver. Free tiers cover thousands of emails a month.

    Get it Resend: resend.com > API Keys > Create; add and verify your domain. Postmark: account > Servers > API Tokens. open ↗

  6. API keyvaries

    Why The SMTP driver, for self-hosting or another provider.

    Get it From any mail host.

  7. have readyfree

    Why Deliverability is judged by real providers.

    Get it Free accounts.

Environment variables

These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.

VariableNeededExampleWhere the value comes from
MAIL_DRIVERrequireddevdev, smtp or resend.
MAIL_FROMrequired'Your App' <hello@mail.yourdomain.com>From address on your verified domain.
RESEND_API_KEYsecretoptionalre_...Resend dashboard.
SMTP_URLsecretoptionalsmtps://user:pass@host:465For the SMTP driver.
MAIL_DEV_DIRoptional./mail-outWhere the dev driver writes .eml files.

The build, in order

  1. The interface and two local drivers

    send() with a typed result; dev writes files; SMTP sends for real.

    1. terminal
      mkdir mail && cd mail && git init && npm init -y && npm pkg set type=module && npm install nodemailer@6
      mkdir -p mail-out && cp .env.example .env
    done when · tick each as it passes
  2. The hosted driver

    HTTP with timeout and correct retry rules.

    done when · tick each as it passes
  3. The records

    SPF, DKIM, DMARC printed and verified against live DNS.

    done when · tick each as it passes
  4. Bounces and suppression

    Never send again to an address that hard-bounced.

    done when · tick each as it passes
  5. Self-host option, honestly

    A documented Postal path with the warm-up cost stated.

    done when · tick each as it passes
what this build does not replace
after v1, if you want it

Need the files? The project pack on the verdict page hands your agent the whole brief · more email.