Email API for Developers

Send, track, and manage email programmatically with a clean RESTful API and SMTP relay. Ship email features faster with one HTTPS endpoint, code examples in four languages, and per-message delivery status.

4 Language Examples
50ms Median API Latency
99.99% API Uptime SLA

Two Ways to Send — One Reliable Platform

Whether you prefer a modern RESTful API or a traditional SMTP relay, QueenSMTP.COM gives you both options on the same platform. The REST API returns a message id and delivery status for every send, while SMTP relay lets you integrate without changing a single line of application code. Both methods share the same sending infrastructure, reputation management, and analytics dashboard.

Every API call is authenticated with your API key, which can be restricted to specific sending domains and source IP addresses, and each key records when it was last used. Test against your own mailbox first; every refusal returns a stable error code and a retryable flag, so your integration reacts to codes instead of parsing prose.

API Features

🔗

RESTful API

Send an email with a simple POST request. JSON request and response bodies, predictable resource URLs, and standard HTTP status codes make integration straightforward.

📩

SMTP Relay

Point your application, CMS, or mail library at our SMTP endpoint. Authenticate with your API key, and every message is routed through QueenSMTP.COM's optimised delivery network automatically.

🔌

Webhooks (in development)

Signed HTTP POST events for delivered, deferred, bounced, complained, opened, clicked, unsubscribed and rejected messages are being built. Until they ship, read per-message status from GET /v1/messages/:id or the dashboard message log.

🎨

Delivery Status

Every send returns a message id. Poll GET /v1/messages/:id for queued, sent or failed, or read the full message log with the reason for every refusal on your dashboard.

📥

Stable Error Codes

Every refusal carries a machine-readable code and a retryable flag, so your integration knows whether to retry, fix the request, or stop. One recipient per request keeps each message's status, unsubscribe link and tracking its own.

🌐

Code Examples in Four Languages

cURL, Node.js, Python and PHP examples on your dashboard. The API is plain HTTPS with a Bearer token, so the HTTP client you already have is the only dependency.

Send Your First Email in Seconds

Use a single cURL command to send an email through the QueenSMTP.COM API. Replace YOUR_API_KEY with the key from your dashboard.

One recipient per request. Send to a list by making one request per address — that is what keeps a bad address from poisoning a whole batch, and it is how per-message delivery status stays meaningful. Set isBulk: true on marketing mail; bulk messages must carry a working unsubscribe, which we attach for you once your tracking domain is set up.

curl -X POST https://queensmtp.com/v1/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "you@yourdomain.com",
    "fromName": "Your Company",
    "to": "recipient@example.com",
    "subject": "Hello from QueenSMTP.COM",
    "html": "<h1>Welcome!</h1><p>Your account is ready.</p>",
    "text": "Welcome! Your account is ready.",
    "replyTo": "support@yourdomain.com",
    "isBulk": false
  }'

The API returns a JSON response with a unique message ID you can use to track delivery status, open events, and click activity.

{
  "id": "msg_abc123def456",
  "status": "queued",
  "message": "Email accepted for delivery."
}

Send from any language

The API is one HTTPS POST with a Bearer token, so it works with the HTTP client you already have — no SDK to install, nothing extra to keep up to date. Here it is in four languages.

Node.js

Built-in fetch, no dependencies.

await fetch("https://queensmtp.com/v1/send", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.QUEENSMTP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    from: "you@yourdomain.com",
    to: "recipient@example.com",
    subject: "Hello",
    text: "Sent through QueenSMTP.",
  }),
});

Python

Using requests.

import os, requests

requests.post(
    "https://queensmtp.com/v1/send",
    headers={"Authorization": f"Bearer {os.environ['QUEENSMTP_API_KEY']}"},
    json={
        "from": "you@yourdomain.com",
        "to": "recipient@example.com",
        "subject": "Hello",
        "text": "Sent through QueenSMTP.",
    },
    timeout=30,
)

PHP

Plain cURL, no packages.

$ch = curl_init("https://queensmtp.com/v1/send");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("QUEENSMTP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "from" => "you@yourdomain.com",
    "to" => "recipient@example.com",
    "subject" => "Hello",
    "text" => "Sent through QueenSMTP.",
  ]),
]);
$response = curl_exec($ch);

Go

Standard library only.

body, _ := json.Marshal(map[string]string{
    "from":    "you@yourdomain.com",
    "to":      "recipient@example.com",
    "subject": "Hello",
    "text":    "Sent through QueenSMTP.",
})
req, _ := http.NewRequest("POST",
    "https://queensmtp.com/v1/send", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("QUEENSMTP_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)

Prefer SMTP? Every account also gets standard SMTP credentials that work with Nodemailer, PHPMailer, Python smtplib, Rails Action Mailer and anything else that speaks SMTP — see the SMTP service page.

API Rate Limits and Scaling

Every QueenSMTP.COM plan includes generous rate limits designed to match real-world sending patterns. Rate limits are applied per API key and measured in requests per second, giving you predictable throughput whether you are sending transactional receipts or processing a large batch import.

Rate Limits by Plan

The Starter plan allows up to 100 requests per second, which is sufficient for most early-stage applications and low-to-medium traffic websites. The Professional plan raises that ceiling to 1,000 requests per second, supporting high-volume SaaS platforms, e-commerce stores with frequent order activity, and applications that rely on real-time notification delivery. For organisations with requirements beyond these thresholds, the Enterprise plan offers custom rate limits tailored to your architecture, including dedicated sending pools and priority queue access.

Burst Capacity

Momentary traffic spikes are normal. QueenSMTP.COM accommodates short bursts that exceed your sustained rate limit by up to fifty percent for windows of up to ten seconds. This burst buffer ensures that a sudden wave of signup confirmations or password-reset requests does not trigger immediate rejections. If your application regularly exceeds the sustained limit, the API returns a 429 Too Many Requests response with a Retry-After header indicating when you may resume sending.

Handling Rate Limits with Exponential Backoff

When your application receives a 429 response, the best practice is to retry the request using exponential backoff. Start with a one-second delay, then double the wait time on each consecutive retry up to a maximum of thirty-two seconds. Adding a small random jitter of up to five hundred milliseconds prevents multiple clients from synchronising their retries and creating another surge. All official QueenSMTP.COM SDKs implement this retry strategy automatically, so you benefit from it without writing custom logic.

Connection Pooling Best Practices

For high-throughput integrations, reuse HTTP connections rather than opening a new connection for every request. Most HTTP client libraries support persistent connections through connection pooling. Keep the pool size between ten and fifty connections, and set an idle timeout of sixty seconds to release unused sockets. Connection reuse reduces TCP handshake overhead and TLS negotiation time, lowering your effective latency from roughly one hundred and fifty milliseconds to under fifty milliseconds per request. If you are using the SMTP relay, maintain a persistent SMTP session and pipeline multiple messages over the same connection for similar performance gains.

Email API Security

Security is foundational to every layer of the QueenSMTP.COM platform. From key generation to event delivery, each component is designed to protect your data, your recipients, and your sending reputation.

API Key Management

API keys are generated in your dashboard and can be revoked or rotated at any time without downtime. We recommend creating separate keys for each environment — development, staging, and production — so that revoking a compromised key in one environment does not disrupt the others. Keys are stored using one-way hashing on our servers, which means even in the unlikely event of a data breach, raw key values cannot be recovered.

Domain-Scoped Keys

Each API key can be scoped to one or more verified sending domains. A domain-scoped key can only send from addresses that belong to its authorised domains, preventing misuse if a key is accidentally exposed. This granular scoping also simplifies compliance audits by clearly linking each key to a specific business unit, product line, or client.

IP Allowlisting

For an additional layer of protection, you can restrict each API key to a set of approved IP addresses or CIDR ranges. Requests originating from any other IP are rejected with a 403 Forbidden response before they reach the sending pipeline. IP allowlisting is especially valuable for production keys that should only be used from known server infrastructure, eliminating the risk of key misuse from unauthorised networks.

TLS-Only Connections

All communication with the QueenSMTP.COM API and SMTP endpoints is encrypted using TLS 1.2 or higher. Plaintext connections are refused at the network level. This ensures that API keys, email content, and recipient data are never transmitted in the clear, meeting the encryption requirements of GDPR, HIPAA, and SOC 2 compliance frameworks.

Webhook Signatures (in development)

When webhooks ship, every payload will be signed with HMAC-SHA256 using a per-endpoint secret. The X-QueenSMTP-Signature header will carry t=<unix>,v1=<hex>, where v1 is the HMAC of t + "." + rawBody. Verify it, and reject timestamps older than five minutes, before processing an event.

Key Usage Tracking

Each API key records when it was last used and how many requests it has made, and can be revoked or regenerated instantly from your dashboard. Every message you send, and every one we refuse, is listed in your message log with its status and reason.

API vs SMTP: When to Use Each

QueenSMTP.COM supports both a modern REST API and a traditional SMTP relay, and both options share the same underlying delivery infrastructure. Choosing the right method depends on your application architecture, development preferences, and feature requirements.

Advantages of the REST API

The REST API is the best choice when you need access to the full range of QueenSMTP.COM features. A message id and per-message delivery status come back on every send, and refusals carry machine-readable error codes. The JSON-based request and response format integrates naturally with modern web frameworks, serverless functions, and microservice architectures. Error handling is more expressive — the API returns structured error objects with machine-readable codes, making it easier to implement granular retry logic and alerting. If you are building a new application or refactoring an existing one, the REST API provides the richest developer experience and the greatest flexibility for future growth.

Advantages of SMTP Relay

SMTP relay shines when you need to add reliable delivery to an application that already sends email through a standard mail library. Content management systems like WordPress, e-commerce platforms like Magento, and enterprise tools like SAP can be configured to use QueenSMTP.COM by updating SMTP credentials — no code changes, no SDK installation, and no deployment required. SMTP is also the right choice for legacy systems where modifying source code is impractical or where the development team is not available to build a new integration. Because SMTP is a universal protocol, virtually every programming language and framework supports it natively.

Making the Right Choice

For most new projects, we recommend starting with the REST API for per-message status and machine-readable error codes. If you are migrating an existing system and need to minimise code changes, begin with SMTP relay and transition specific workflows to the API over time as your needs evolve. Both methods can be used simultaneously on the same account, so you do not have to choose one exclusively. Learn more about our SMTP capabilities on the SMTP Service page, or explore our developer-focused SMTP guide at SMTP for Developers.

Common Integration Patterns

Understanding proven integration patterns helps you architect your email system for reliability, maintainability, and scale. Below are four patterns that cover the majority of production use cases.

Signup Verification Flow

When a new user registers, your application generates a unique verification token, stores it with an expiry timestamp, and sends a verification email through the QueenSMTP.COM API, rendered from your own template in your application. The email includes a personalised call-to-action link containing the token. Polling GET /v1/messages/:id with the returned id tells you whether the message was delivered; when webhooks ship (in development) the message.delivered and message.opened events will push the same information to you. If the message bounces, you can flag the account and prompt the user to re-enter their address on next login. This pattern ensures a clean user list from the very first interaction and reduces downstream deliverability issues.

E-Commerce Order Pipeline

Online stores typically send a sequence of transactional emails: order confirmation, payment receipt, shipping notification, and delivery confirmation. Each email is triggered by a state change in your order management system. Record the message id each stage returns against the order, so support can see exactly what was sent and whether it was delivered. During a flash sale, send one request per confirmation from a queue in your application; the API accepts them as fast as you submit them. A review request five days after delivery is a scheduled job in your application that calls the API when the time comes. Visit Transactional Email Service for a deeper look at building reliable order pipelines.

SaaS Notification System

Software-as-a-service platforms generate a high volume of event-driven notifications: workspace invitations, usage alerts, billing reminders, and weekly digest reports. The recommended architecture places a lightweight message queue between your application and the QueenSMTP.COM API. When an event occurs, your application publishes a job to the queue with the recipient and the data the message needs. A background worker consumes the queue, renders the email, sends it through the API, and records the returned message ID for tracking. This decoupled design prevents email-sending latency from blocking your application's primary request cycle and provides natural retry semantics if the API is temporarily unreachable.

Marketing Automation Workflow

For marketing campaigns, newsletters, and re-engagement sequences, the QueenSMTP.COM API supports large-scale batch sending with per-recipient personalisation. A typical workflow begins with segment selection from your customer database, followed by one API call per recipient, each carrying that recipient's personalisation. Open and click data is available per message in the dashboard, and open and click webhooks (in development) will feed it back into your analytics platform, allowing you to build automated sequences — for example, sending a follow-up offer to recipients who opened the initial campaign but did not click through. Suppression list synchronisation via the API ensures that unsubscribed and bounced addresses are excluded automatically. Explore our Bulk Email Service page for more on high-volume sending strategies.

Frequently Asked Questions

QUEENSMTP.COM provides official SDKs for Node.js, Python, PHP, Ruby, Java, Go, and C#. Our REST API also works with any language that can make HTTP requests.

Yes, you can use our REST API for programmatic sending or SMTP relay for easy integration with existing applications. Both methods support the same features and share the same analytics.

Not yet. Webhooks for delivered, deferred, bounced, complained, opened, clicked, unsubscribed and rejected events, with signed payloads, are in development. Until they ship, use GET /v1/messages/:id and the dashboard message log.

Standard accounts are rate limited to 100 requests/second, and Enterprise plans get custom limits. Batch endpoints allow sending up to 1,000 emails per request.

Sign up for a free account, generate your API key from the dashboard, and start sending emails in minutes. Our documentation includes quickstart guides for every supported language.

You can send up to 10,000 individually personalized messages in a single batch API request. Each recipient receives unique content while you make just one HTTP call, minimizing overhead and latency.

Yes, the QUEENSMTP.COM API supports up to 2 attachments on a paid plan, with a 1 MB total message size. Attachments can be sent as base64-encoded content or referenced by URL for the API to fetch at send time.

Our SDKs implement automatic retry logic with exponential backoff for transient errors. For custom implementations, check the HTTP status code — 4xx errors indicate client issues (do not retry), while 5xx errors are temporary server issues (safe to retry with backoff).

Yes, QUEENSMTP.COM provides a sandbox mode for development and testing. Sandbox requests validate your payload and return realistic responses without actually delivering emails, so you can test your integration safely.

The API provides endpoints for retrieving per-message events (delivery, open, click, bounce, complaint), aggregate statistics by domain or tag, and time-series data for trend analysis. All data is available in real-time.

Build Email Into Your Product Today

Create a free account, grab your API key, and send your first email in under five minutes. No contracts, no credit card, and 100 free emails every day.