Mail API · by WebXIO

One request. Your mail is on its way.

SMTP-Relay takes your application's mail through a REST API, fills in the template in the right language and your layout and delivers it through your own mail account: Microsoft 365, Google or any SMTP server. With a queue, retries, failover, a spam filter and a log, operated by WebXIO in Europe.

admin.smtp-relay.at — api/v1/send

Request

curl -X POST \
  https://admin.smtp-relay.at/api/v1/send \
  -H "Authorization: Bearer $SMTP_RELAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "anna@example.com",
    "templateId": 7,
    "language": "de-AT",
    "variables": { "firstName": "Anna" }
  }'

Response

HTTP/1.1 202 Accepted
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59

{"id":42,"status":"queued","language":"de"}

SMTP-Relay in numbers

Endpoint
POST /api/v1/send
Delivery attempts
up to 5
Languages per template
up to 50
Hosting
Europe, self-hosted

01How it works

From request to inbox.

Your application sends one request, the relay does the rest: check, render, queue, deliver.

  1. Your application

    Sends recipients, template and variables as JSON, with attachments if needed, authenticated with its project's API key.

    Bearer srk_…
  2. Checks

    Key, rate limit and content are checked, and for spam if you like. As soon as the mail is queued, the API answers with an ID.

    202 Accepted
  3. Template

    The template is rendered in the matching language (the exact one, base language, English, German) and placed in the project's layout.

    Handlebars
  4. Queue

    Up to 5 attempts with growing pauses. Permanent errors such as an unknown recipient are not retried.

    BullMQ · Valkey
  5. Your mail account

    Mail goes out through your project's SMTP account: Microsoft 365, Google or any other server. If it fails, another linked account takes over at once.

    SMTP
  6. Inbox

    The status changes to “sent”, with message ID and timestamp. Available through the API and in the log.

    status: sent

Mail is sent through your own account: sender address, SPF and DKIM stay with your mail provider.

02Features

Everything between your app and the inbox.

What your application would otherwise have to build itself is part of the relay, managed in the admin UI.

Templates

Subject, HTML and text with placeholders, conditions and loops. In the admin UI with a visual editor, images and live preview.

  • Syntax errors show up when you save, not when you send
  • Values escaped in HTML automatically, multi-line ones with {{nl2br}}
  • Plain-text version in one click from the content
  • Handlebars
  • HTML + Text

Layouts & images

Header image or logo, colour and footer as a frame around your templates. Every project has a default layout, a template can also pick its own or none.

  • PNG, JPEG or GIF up to 512 KB, sent inline without a public URL
  • CSS is inlined for mail clients
  • The preview shows the size, Gmail clips at about 102 KB
  • 600 px
  • PNG · JPEG · GIF
  • cid:

Attachments

Invoices, exports or files from a form go along as base64 in the same request, with or without a template. A mail goes out with all of its files or not at all.

  • Up to 16 MB and 50 files per mail
  • Images in the HTML via cid:, executable files are refused
  • Stored only until sent, name and size stay in the log
  • base64
  • cid:
  • PDF · CSV · …

Multilingual

Up to 50 translations per template. You send the language along, the relay picks the matching translation.

  • BCP 47 language codes, such as de-AT
  • Fallback: exact, base language, English, German
  • The response names the language used
  • BCP 47
  • de-AT → de → en

Queue & retries

Every mail goes into the queue first. If every mail account of the project fails, the relay tries up to 5 times.

  • Pauses: 30 s · 1 min · 2 min · 4 min
  • Permanent errors (SMTP 5xx) are not retried
  • 503 instead of silent loss when the queue is down
  • BullMQ
  • Valkey

Your own mail accounts

Several SMTP accounts per project, one of them the default. The sender name is set by the project or, if it has none, by each mail's fromName. No account? We provide one on request.

  • Connection test right in the admin UI
  • Encryption: none, SSL, TLS or STARTTLS
  • Credentials stored encrypted (AES-256-GCM)
  • Microsoft 365
  • Google
  • SMTP

Failover

If a mail account fails, the next linked one takes over at once, within the same attempt. Without a default the accounts take turns, and accountId decides which one goes first.

  • Every attempt tries all active linked accounts
  • A failing account goes last for 60 seconds
  • The sender name stays, the address is that of the account that delivers
  • Failover
  • Round Robin
  • accountId

API keys & rate limit

Every project gets its own named keys, for production and testing for example. Rotating gives a key a new secret and the old one stops at once. Revoking takes one click.

  • A key is shown once, only its hash is stored
  • 60 by default, at most 100 mails per minute and project
  • 429 with Retry-After when exceeded
  • Bearer srk_…
  • 429 + Retry-After

Development mode

While you build a form or an integration, every mail of the project goes to a test address instead of real recipients. Your code doesn't notice.

  • The subject names the recipient: [DEV → max@example.com +2]
  • cc and bcc are dropped, sender, template and layout stay
  • No test address means 422, never a send to the real recipients
  • [DEV → …]
  • devRecipient

Spam filter

Switched on per project, for contact forms. Suspicious mails are held instead of sent, an admin decides. The filter learns from every decision and, once trained enough, sorts out clear spam by itself.

  • Only what submitters type is checked: variables and replyTo
  • Automatic only when the rules and the Bayes classifier are both very sure
  • Suspected senders apply to every project with the filter
  • held
  • spam
  • Bayes

Log & dashboard

Every mail with status, attempts, errors and the mail account that delivered it, filterable by project, status and free text.

  • Sent, failed, delivery rate, queue and spam
  • History over 7, 14, 30 days or all time
  • Busiest projects and recent failures at a glance
  • queued
  • sending
  • sent
  • failed
Planned

Not available yet, but on the way:

  • Webhooks
  • Bounce handling
  • DKIM / SPF
  • Open and click tracking

03API

One endpoint. No SDK required.

A POST with JSON is all it takes, from any language and any framework, attachments included. Look up the status of every mail by its ID. For Node.js there is a small package as well.

Two ways to send

  1. With a template

    templateId, variables and optionally language. Content and translations live in the admin UI, your code stays lean.

  2. Without a template

    subject plus html and/or text right in the request, for mail whose content your application generates itself.

More fields

cc, bcc
Copy and blind copy; a mail to bcc only needs no to
replyTo
Replies go to this address, such as a form's submitter
fromName
Sender name of this mail, if the project has no fixed one
headers
Message-ID, In-Reply-To and References for threads, List-*, X-*
accountId
The mail account tried first
attachments
Files as base64, images in the HTML via cid:
Delivery — mail 42
  1. curl …/api/v1/messages/42
  2. queued id 42 · template 7 · de
  3. sending attempt 1 of 5 · M365
  4. sending 421 try again later · on to Google
  5. sent 250 OK · via Google
@webxio/smtp-relay

TypeScript

import { attachment, createRelay } from "@webxio/smtp-relay";

const relay = createRelay({
  apiKey: process.env.SMTP_RELAY_KEY,
});

const { id, status } = await relay.send({
  to: "anna@example.com",
  templateId: 7,
  variables: { firstName: "Anna" },
  attachments: [attachment("rechnung-1042.pdf", pdf)],
});

Node.js 22 or newer, MIT licence, installs without a token through one line in .npmrc. Installation and contact forms

GET /api/v1/messages/42

Look up the status

{
  "id": 42,
  "status": "sent",
  "attempts": 1,
  "language": "de",
  "messageId": "<5f1c…@example.com>",
  "sentAt": "2026-09-29T09:14:03.000Z",
  "error": "M365: 421 try again later",
  "attachments": [
    {
      "filename": "rechnung-1042.pdf",
      "contentType": "application/pdf",
      "size": 48213,
      "disposition": "attachment",
      "contentId": null,
      "removed": "sent"
    }
  ]
}

Error codes

400
Invalid request, such as an address, language code, header or attachment
401
API key missing, invalid or revoked
403
Project deactivated, applies to every route under /api/v1
413
Too large: attachments over 16 MB or the rest over 2 MB
422
Template or mail account not linked or inactive, rendering failed, development mode without test address
429
Rate limit reached, respect Retry-After
503
Queue unavailable, mail not accepted

Limits

Recipients
up to 50 each in to, cc and bcc
Request
up to 2 MB of JSON without attachments
Attachments
up to 16 MB, 50 files per mail
Subject
up to 998 characters
Rate limit
60 per minute, up to 100
Images
PNG, JPEG, GIF up to 512 KB

Use the API key on the server only, never in the browser.

04Operations

No mail gets lost silently.

The relay is built to be traceable: every accepted mail has an ID, a status and a history.

Principles

  1. Accepted means queued

    The API only answers once the mail is safely in the queue. Otherwise you get a 503, and your application knows.

  2. Lost jobs come back

    An update lets running deliveries finish first. If a job still gets lost, in a crash for example, the relay queues the mail again by itself or marks it as failed.

  3. Encrypted credentials

    SMTP passwords are stored AES-256-GCM encrypted, API keys only as a SHA-256 hash.

  4. Separate accounts

    Every user only sees their own mail accounts, templates and projects. Access starts with an invitation, and only the user ever sets their password.

  5. Your sender stays yours

    Mail goes out through your own account. Sender address, reputation, SPF and DKIM stay with your provider.

  6. European infrastructure

    Operated by WebXIO on its own infrastructure in Europe, built and shipped through its own GitLab.

  7. We use it ourselves

    The relay sends its own sign-in mails through itself, as well as the contact forms of webxio.at and this site.

Under the hood

Europe

A lean stack of proven, open building blocks.

API & admin
admin.smtp-relay.at
Backend
NestJS · PostgreSQL
Queue
BullMQ · Valkey
Delivery
Nodemailer · SMTP
Admin UI
Vue · German & English · mobile
Location
Europe, self-hosted

05FAQ

What it is, and what it isn't.

Straight answers to the most common questions.

Is SMTP-Relay an SMTP server?

No. There is no port for mail clients to connect to. Your application talks to an HTTPS API, and the relay then sends through an SMTP account.

Do I need my own mail account?

No. Ideally you send through your own SMTP account, such as Microsoft 365, Google Workspace or your host's, so your domain is the sender. If you don't have one, we provide a mailbox on request, with an address under smtp-relay.at, and replies reach you via replyTo. Choose “None yet, I'd like one from WebXIO” in the form.

What happens if my mail account fails?

If another account is linked to the project, it takes the mail at once, within the same attempt. If all of them fail, the relay tries up to 5 times with growing pauses. The sender name stays the same, the address is always that of the account that delivers. The log shows which account sent the mail and which ones failed before.

Does the relay handle SPF, DKIM and DMARC?

Not yet. Those records belong to your domain and your mail provider, which signs the mail. DKIM support in the relay is planned.

Are there attachments, webhooks or bounce handling?

Attachments, yes: up to 16 MB and 50 files per mail, as base64 in the request, with or without a template. Images in the HTML are referenced via cid:, executable files are refused. Once the mail is sent, the relay deletes the files, name and size stay in the log. Webhooks, bounce handling and open and click tracking are planned. Until then, look up the delivery status with GET /api/v1/messages/:id.

Can I test without mailing real recipients?

Yes, with the project's development mode. Every mail then goes to a test address, and the subject names the original recipient. Your application gets the same response as usual, nothing changes in your code.

Does the relay protect my contact form from spam?

If you like. With the spam filter on, the relay holds suspicious mails (status “held”), and an admin reviews them and sees their content. Once trained enough, the filter recognises clear spam by itself and doesn't send it at all (status “spam”), without anyone reviewing it. Only the typed input is checked, so send it as variables and the submitter's address as replyTo. Passed mails with typed input are kept for 30 days, visible to admins only, so the filter learns from them too. Spam the filter recognised by itself loses its content after 30 days; if an admin confirms it before, it is kept as a training example.

Is there an SDK?

For Node.js there is the @webxio/smtp-relay package (MIT licence, installs without a token): send() with types, attachment() for files, project() to check the key and contactForm() for contact forms with a honeypot, Cap.js check, forwarding and confirmation. From any other language one HTTP request does it, and the admin UI shows a ready-made curl call for every project.

How much can I send?

60 mails per minute per project by default, at most 100. Your mail provider's limits apply too: Microsoft 365, for example, allows 30 per minute.

Is it suitable for newsletters?

No. Without unsubscribe management and bounce handling, the relay is meant for transactional mail: confirmations, notifications, contact forms.

How do I get access?

Through the form below. Accounts are created by a person, there is no self sign-up. You get an invitation by mail and set your password yourself. Then you set up your mail account, templates and project in the admin UI, together with us if you like.

06Access

Request access.

Accounts are set up by a person, not a machine. Tell us briefly what you need the relay for.

What happens next

  1. You briefly describe your application and your mail account.
  2. We get back to you and clarify scope and setup.
  3. You get an invitation to the admin UI by mail, set your password and set up mail account, templates and API key, together with us if you like.

Optional, e.g. https://example.com

Your mail is sent through this account.

Which application, which mails? At least 10 characters.