Sendry Docs
API Reference

SMTP Relay

Use Sendry as an SMTP relay — connect any app that speaks SMTP.

Sendry provides an SMTP relay for applications that cannot use the REST API directly. Connect using standard SMTP and authenticate with any Sendry API key that has sending_access scope.

This is ideal for:

  • Legacy apps that only support SMTP
  • Self-hosted tools like Gitea, n8n, or Directus
  • Email clients and mail merge tools

Connection details

Fetch your current SMTP connection settings from the API:

GET /v1/smtp/info

Requires any valid API key (read_only or higher).

Response

{
  "host": "smtp.sendry.online",
  "port": 587,
  "tls": false,
  "auth": {
    "username": "(any value)",
    "password": "use any API key with sending_access scope"
  }
}

Settings at a glance

SettingValue
Hostsmtp.sendry.online
Port587 (STARTTLS)
SecuritySTARTTLS (upgrade on connect)
UsernameAny non-empty string (e.g. sendry)
PasswordYour Sendry API key (sn_live_...)

Port 465 (SMTPS/implicit TLS) is not currently supported. Use port 587 with STARTTLS.


Configuration examples

Nodemailer (Node.js)

import nodemailer from "nodemailer";

const transporter = nodemailer.createTransport({
  host: "smtp.sendry.online",
  port: 587,
  secure: false, // STARTTLS
  auth: {
    user: "sendry",
    pass: process.env.SENDRY_API_KEY,
  },
});

await transporter.sendMail({
  from: "hello@acme.com",
  to: "user@example.com",
  subject: "Hello from SMTP!",
  html: "<p>Sent via Sendry SMTP relay.</p>",
});

Python (smtplib)

import smtplib
import os
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

msg = MIMEMultipart("alternative")
msg["From"] = "hello@acme.com"
msg["To"] = "user@example.com"
msg["Subject"] = "Hello from SMTP!"
msg.attach(MIMEText("<p>Sent via Sendry SMTP relay.</p>", "html"))

with smtplib.SMTP("smtp.sendry.online", 587) as smtp:
    smtp.ehlo()
    smtp.starttls()
    smtp.login("sendry", os.environ["SENDRY_API_KEY"])
    smtp.sendmail("hello@acme.com", ["user@example.com"], msg.as_string())

Go

package main

import (
    "net/smtp"
    "os"
)

func main() {
    auth := smtp.PlainAuth(
        "",
        "sendry",
        os.Getenv("SENDRY_API_KEY"),
        "smtp.sendry.online",
    )

    msg := []byte(
        "From: hello@acme.com\r\n" +
        "To: user@example.com\r\n" +
        "Subject: Hello from SMTP!\r\n" +
        "MIME-Version: 1.0\r\n" +
        "Content-Type: text/html\r\n\r\n" +
        "<p>Sent via Sendry SMTP relay.</p>",
    )

    err := smtp.SendMail(
        "smtp.sendry.online:587",
        auth,
        "hello@acme.com",
        []string{"user@example.com"},
        msg,
    )
    if err != nil {
        panic(err)
    }
}

Environment variable approach (12-factor apps)

Most tools that support SMTP will accept a SMTP_URL:

smtp://sendry:sn_live_your_api_key@smtp.sendry.online:587

Set this as an environment variable and reference it in your app config.


Domain verification

SMTP sends are subject to the same domain verification requirement as the REST API. The From address must use a domain that is verified in your Sendry account.

To verify a domain: go to Domains in the dashboard, or use the Domains API.

During development, use a test-mode key (sn_test_...) to bypass domain verification.


Limitations

FeatureREST APISMTP relay
AttachmentsYesYes
Custom headersYesYes
Batch sendingYesNo
TemplatesYesNo
SchedulingYesNo
Open/click trackingYesPartial*

*Tracking via SMTP works for open tracking (pixel injection) but link wrapping for click tracking requires the tracking header to be set.


Troubleshooting

Authentication failed — Verify your API key has sending_access scope and is not expired.

Domain not verified — The From address domain must be verified. See Domains.

Connection refused — Ensure your network allows outbound connections on port 587. Some cloud providers block this by default (e.g., AWS EC2 — use the REST API instead).

STARTTLS required — You must call STARTTLS before authenticating. Set secure: false and enable STARTTLS negotiation in your client.

On this page