Integrations
Any language can reach SingleMail with a plain HTTPS request, and apps you can't change can use SMTP. The examples below are filled in with SingleMail's real values.
Node.js / TypeScript
npm i @singlemail/node
SINGLEMAIL_API_KEY=sm_… SINGLEMAIL_BASE_URL=https://api.singlemail.singleton.com.tr
import { SingleMail } from "@singlemail/node";
const sm = new SingleMail();
// With an attachment and scheduling
const { data, error } = await sm.emails.send({
from: "Uygulama <no-reply@firma.com>",
to: ["ali@ornek.com"],
subject: "Your monthly report",
html: "<p>The report is attached.</p>",
attachments: [{ filename: "rapor.pdf", content: await fs.readFile("rapor.pdf") }],
tags: [{ name: "type", value: "report" }],
scheduledAt: "in 1 hour",
}, { idempotencyKey: "report-2026-10" });
if (error) console.error(error.name, error.message);The SDK never throws on API errors; every call returns { data, error }. Requests repeated with the same idempotencyKey never create a second email, so retrying after network errors is safe.
PHP
$ch = curl_init("https://api.singlemail.singleton.com.tr/emails");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("SINGLEMAIL_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"from" => "Uygulama <no-reply@firma.com>",
"to" => ["ali@ornek.com"],
"subject" => "We got your order",
"html" => "<p>…</p>",
]),
]);
$res = json_decode(curl_exec($ch), true); // ["id" => "…"].NET (C#)
var http = new HttpClient { BaseAddress = new Uri("https://api.singlemail.singleton.com.tr") };
http.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", config["SingleMail:ApiKey"]);
var res = await http.PostAsJsonAsync("/emails", new {
from = "Uygulama <no-reply@firma.com>",
to = new[] { "ali@ornek.com" },
subject = "Your appointment is confirmed",
html = "<p>…</p>",
});
res.EnsureSuccessStatusCode();Python
import os, requests
r = requests.post(
"https://api.singlemail.singleton.com.tr/emails",
headers={"Authorization": f"Bearer {os.environ['SINGLEMAIL_API_KEY']}"},
json={"from": "Uygulama <no-reply@firma.com>", "to": ["ali@ornek.com"], "subject": "…", "html": "<p>…</p>"},
timeout=10,
)
r.raise_for_status()
print(r.json()["id"])SMTP
Apps that can't call an API can use SingleMail like any SMTP server. Messages arriving over SMTP go into the same queue and logs, with the same DKIM signing and tracking.
| Setting | Value |
|---|---|
| Host | smtp.singlemail.singleton.com.tr |
| Port | 2587 |
| Encryption | STARTTLS |
| Username | singlemail |
| Password | Your API key (sm_…) |
MAIL_MAILER=smtp MAIL_HOST=smtp.singlemail.singleton.com.tr MAIL_PORT=2587 MAIL_USERNAME=singlemail MAIL_PASSWORD=sm_… MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS=no-reply@firma.com
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" EMAIL_HOST = "smtp.singlemail.singleton.com.tr" EMAIL_PORT = 2587 EMAIL_HOST_USER = "singlemail" EMAIL_HOST_PASSWORD = os.environ["SINGLEMAIL_API_KEY"] EMAIL_USE_TLS = True
WordPress: In the “WP Mail SMTP” plugin, choose Other SMTP and enter the values above.
n8n: Create an SMTP credential in the “Send Email” node, or call POST /emails with an “HTTP Request” node, which also lets you send tags and an idempotency key.
Limits
| Limit | Value |
|---|---|
| Request rate | 10 requests per second per project (admins can change it) |
| Recipients | Up to 50 per email (to + cc + bcc) |
| Batch | 100 emails per request |
| Size | 40 MB per API request, 25 MB over SMTP; attachment URLs (path) up to 10 MB |
| Custom headers | Up to 20; List-Unsubscribe, In-Reply-To, References and X-* (except X-SES-* and X-SingleMail-*) |
| Scheduling | Up to 30 days ahead |
| Daily quota | Set per project by an admin |
All error codes are listed in the API reference.