Send email API guides for every stack
Step-by-step guides for sending email through tinyRelay: the REST API from cURL, Node.js, Python, PHP, Go and Ruby; the SMTP relay from Laravel, Django, Rails and Supabase; and signed webhooks you can verify.
curl -X POST https://api.tinyemail.com/v1/relay/email/campaign \
-H "Content-Type: application/json" \
-H "X-RELAY-ACCESS-TOKEN: $TINYRELAY_API_KEY" \
--data-binary @reset.json
# HTTP 202 { "requestId": "…", "message": "SUCCESS" }const res = await fetch("https://api.tinyemail.com/v1/relay/email/campaign", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-RELAY-ACCESS-TOKEN": process.env.TINYRELAY_API_KEY,
},
body: JSON.stringify(email),
});# tinyrelay.py (pip install requests)
import os
import requests
API_URL = "https://api.tinyemail.com/v1/relay/email/campaign"$ch = curl_init('https://api.tinyemail.com/v1/relay/email/campaign');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-RELAY-ACCESS-TOKEN: ' . getenv('TINYRELAY_API_KEY'),
],const apiURL = "https://api.tinyemail.com/v1/relay/email/campaign"
req, err := http.NewRequest(http.MethodPost, apiURL, bytes.NewReader(payload))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-RELAY-ACCESS-TOKEN", os.Getenv("TINYRELAY_API_KEY"))module TinyRelay
SEND_URI = URI("https://api.tinyemail.com/v1/relay/email/campaign")
def self.send_email(email)
request = Net::HTTP::Post.new(SEND_URI)
request["X-RELAY-ACCESS-TOKEN"] = ENV.fetch("TINYRELAY_API_KEY")# settings.py
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = os.environ["TINYRELAY_SMTP_HOST"] # [SMTP host]
EMAIL_PORT = int(os.environ["TINYRELAY_SMTP_PORT"]) # [port]
EMAIL_HOST_USER = os.environ["TINYRELAY_SMTP_USER"]
EMAIL_HOST_PASSWORD = os.environ["TINYRELAY_SMTP_PASSWORD"]MAIL_MAILER=smtp
# Issued at onboarding
MAIL_HOST="[SMTP host]"
MAIL_PORT="[port]"
MAIL_USERNAME="[SMTP username]"
MAIL_PASSWORD="[SMTP password]"config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: ENV.fetch("TINYRELAY_SMTP_HOST"), # [SMTP host]
port: Integer(ENV.fetch("TINYRELAY_SMTP_PORT")), # [port]
user_name: Rails.application.credentials.dig(:tinyrelay, :smtp_user_name),
password: Rails.application.credentials.dig(:tinyrelay, :smtp_password),curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \
-H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
-d '{
"smtp_host": "[SMTP host]",
"smtp_port": "[port]",
"smtp_user": "[SMTP username]",Send email from your code.
One HTTPS POST to /email/campaign with your key in X-RELAY-ACCESS-TOKEN. Every guide covers the request body, the 202 response, per-recipient metadata and errors.
Point your mailer at the relay.
Change settings, not code. Your framework keeps sending the way it does today, through the tinyRelay SMTP relay.
Trust what comes back. Honor opt-outs.
No guide matches that search. Try a language or framework name, or browse the tinyRelay docs.
Same infrastructure. Different on-ramps.
Both send through the same tinyRelay infrastructure. The difference is how your app hands the email over.
SMTP vs API, in depth →- Many recipients in one request
- Per-recipient attributes and metadata
- Signed webhooks with your metadata
- Framework mailers and auth providers
- Credentials issued at onboarding
- No integration code
No. There are no packages to install. Every REST API guide uses a standard HTTP client, and tinyRelay works with any language that can make HTTP requests.
Use an SMTP guide when a framework or tool already sends email and you only want to change where it goes. Use a REST API guide when you want one request for many recipients, each with their own attributes and metadata.
They are issued at onboarding together with your SMTP credentials, so the SMTP guides show them as placeholders. API keys are issued at onboarding too.
Send transactional email with a service that reports back.
SMTP relay or REST API, standalone or alongside tinyEmail. Tell us what you send and our team sets you up.