Email API for Developers

Send, track, and manage email programmatically with a clean RESTful API and SMTP relay. Ship email features faster with SDKs in seven languages, detailed documentation, and sandbox testing.

7 Official SDKs
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 offers richer features — template rendering, batch sending, and scheduled delivery — 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 domain-scoped API key, rate-limited to protect your account, and logged for full auditability. Sandbox mode lets you test integrations without sending real emails, so you can iterate safely before going live.

API Features

🔗

RESTful API

Send single or batch emails 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

Subscribe to delivery, bounce, open, click, and complaint events. Receive signed HTTP POST payloads in real time so your application can react instantly to email activity.

🎨

Template Engine

Store reusable email templates on our servers and render them at send time by passing dynamic variables. Supports Handlebars syntax, conditional blocks, and loops for complex layouts.

📥

Batch Sending

Send up to 10,000 individually personalised messages in a single API call. Each recipient gets unique merge data while you make just one HTTP request, reducing overhead and latency.

🌐

Multi-Language SDKs

Official client libraries for Node.js, Python, PHP, Ruby, Java, Go, and C# handle authentication, retries, and serialisation so you can focus on your application logic.

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.

curl -X POST https://api.queensmtp.com/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "you@yourdomain.com",
    "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.",
    "tags": ["onboarding"]
  }'

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."
}

Official SDKs

Install the SDK for your language and start sending with a few lines of code. Every library is open-source, actively maintained, and published to the standard package registry.

Node.js

Available on npm. Supports async/await, streaming attachments, and TypeScript type definitions out of the box.

npm install @queensmtp/node

Python

Available on PyPI. Compatible with Python 3.8+ and provides both synchronous and asyncio clients.

pip install queensmtp

PHP

Available on Packagist. Works with PHP 8.0+ and integrates cleanly with Laravel, Symfony, and WordPress.

composer require queensmtp/php-sdk

Ruby

Available on RubyGems. Provides a simple interface compatible with Rails Action Mailer for drop-in replacement.

gem install queensmtp

Java

Available on Maven Central. Built for Java 11+ with non-blocking HTTP client and full Javadoc documentation.

implementation 'com.queensmtp:sdk:1.0'

Go

Installable via Go modules. Lightweight, dependency-free, and fully compatible with the standard library context package.

go get github.com/queensmtp/go-sdk

C#

Available on NuGet. Targets .NET 6+ and provides async methods throughout for high-throughput applications.

dotnet add package QueenSMTP

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.

HMAC Webhook Signatures

Every webhook payload is signed with an HMAC-SHA256 signature using a per-account secret. Your application should verify this signature before processing the payload to confirm that the event originated from QueenSMTP.COM and was not tampered with in transit. The signature is included in the X-QueenSMTP-Signature header, and all SDKs provide a helper method to perform verification in a single function call.

Audit Logging

All API activity — key creation, sending requests, configuration changes, and login events — is recorded in a tamper-proof audit log accessible from your dashboard. Logs are retained for ninety days on all plans and up to one year on Enterprise plans. You can filter by date, key, event type, or IP address, making it straightforward to investigate anomalies or satisfy compliance requests.

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. Template rendering, batch sending with per-recipient merge variables, scheduled delivery, and inline analytics queries are all available exclusively through the API. 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 to take advantage of templates, batch operations, and scheduling. 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 using a pre-built template. The template includes a personalised call-to-action link containing the token. A webhook subscription on the delivered event lets you confirm the message reached the inbox, while a subscription on the opened event helps you measure engagement. 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. Using tagged API calls, you can label each message with its order stage and query aggregate analytics later to identify drop-off points. Batch sending is useful during flash sales when hundreds of order confirmations must be dispatched within seconds. Scheduled delivery can hold a review-request email until five days after delivery, maximising the chance of a response. 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, template identifier, and merge variables. A background worker consumes the queue, renders the email via the API, and records the 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 a batch API call that sends up to ten thousand personalised messages in a single request. Open and click webhooks feed engagement data 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.

Yes, we support real-time webhooks for all email events including delivery, bounce, open, click, unsubscribe, and spam complaint. Configure webhook URLs through the dashboard or API.

API rate limits depend on your plan. Starter: 100 requests/second, Professional: 1,000 requests/second, Enterprise: 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 file attachments up to 25MB total per message. 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 1,000 free emails every month.