Send over SMTP
Already have an app, CMS, or CRM that speaks SMTP — WordPress, a billing tool, a Django or Laravel app, a Postfix relay? Point it at MailKite and you're sending. No SDK, no rewrite. It runs on the same domains, the same deliverability, and shows up in the same logs as the Send API.
Connection details
Drop these into your app's SMTP settings. Your password is your MailKite API key — there's no separate SMTP credential to create.
| Host | smtp.mailkite.dev |
| Port | 587 (STARTTLS, recommended) · 465 (implicit TLS) |
| Username | mailkite — any username works; we authenticate on the password |
| Password | Your API key (mk_live_…) |
| Encryption | Required. STARTTLS on 587, implicit TLS on 465 |
| From | An address on a domain you've verified for sending (SPF + DKIM) |
Send from your stack
Any standard mail library works — there's nothing of ours to install. Pick your language:
import nodemailer from "nodemailer";
const tx = nodemailer.createTransport({
host: "smtp.mailkite.dev",
port: 587, // STARTTLS · use 465 for implicit TLS
auth: {
user: "mailkite", // any username works
pass: process.env.MAILKITE_API_KEY, // your mk_live_… key
},
});
await tx.sendMail({
from: "hello@myapp.ai", // an address on a verified domain
to: "ada@example.com",
subject: "Your invoice #1042",
html: "<p>Thanks! Receipt attached.</p>",
});import os, smtplib
from email.message import EmailMessage
msg = EmailMessage()
msg["From"] = "hello@myapp.ai" # an address on a verified domain
msg["To"] = "ada@example.com"
msg["Subject"] = "Your invoice #1042"
msg.set_content("Thanks! Receipt attached.")
# Standard library — no dependency to install.
with smtplib.SMTP("smtp.mailkite.dev", 587) as s:
s.starttls()
s.login("mailkite", os.environ["MAILKITE_API_KEY"]) # password = your key
s.send_message(msg)<?php
use PHPMailer\PHPMailer\PHPMailer;
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'smtp.mailkite.dev';
$mail->SMTPAuth = true;
$mail->Username = 'mailkite'; // any username
$mail->Password = getenv('MAILKITE_API_KEY'); // your mk_live_… key
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587; // or 465 for implicit TLS
$mail->setFrom('hello@myapp.ai'); // an address on a verified domain
$mail->addAddress('ada@example.com');
$mail->Subject = 'Your invoice #1042';
$mail->Body = 'Thanks! Receipt attached.';
$mail->send();Properties p = new Properties();
p.put("mail.smtp.host", "smtp.mailkite.dev");
p.put("mail.smtp.port", "587"); // 465 for implicit TLS
p.put("mail.smtp.auth", "true");
p.put("mail.smtp.starttls.enable", "true");
Session s = Session.getInstance(p, new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
// username = anything · password = your mk_live_… key
return new PasswordAuthentication("mailkite", System.getenv("MAILKITE_API_KEY"));
}
});
Message msg = new MimeMessage(s);
msg.setFrom(new InternetAddress("hello@myapp.ai")); // a verified domain
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse("ada@example.com"));
msg.setSubject("Your invoice #1042");
msg.setText("Thanks! Receipt attached.");
Transport.send(msg);auth := smtp.PlainAuth("", "mailkite", os.Getenv("MAILKITE_API_KEY"), "smtp.mailkite.dev")
msg := []byte("From: hello@myapp.ai\r\n" + // an address on a verified domain
"To: ada@example.com\r\n" +
"Subject: Your invoice #1042\r\n\r\n" +
"Thanks! Receipt attached.\r\n")
// STARTTLS on 587; SendMail upgrades the connection before AUTH.
err := smtp.SendMail("smtp.mailkite.dev:587", auth,
"hello@myapp.ai", []string{"ada@example.com"}, msg)require "mail"
Mail.defaults do
delivery_method :smtp, {
address: "smtp.mailkite.dev",
port: 587, # 465 for implicit TLS
user_name: "mailkite", # any username
password: ENV["MAILKITE_API_KEY"], # your mk_live_… key
enable_starttls_auto: true,
}
end
Mail.deliver do
from "hello@myapp.ai" # an address on a verified domain
to "ada@example.com"
subject "Your invoice #1042"
body "Thanks! Receipt attached."
end WordPress, frameworks & no-code
If a tool has an SMTP settings panel, it works. For WordPress, use a plugin like WP Mail SMTP and fill in the connection details:
WP Mail SMTP → Settings → Other SMTP
Host smtp.mailkite.dev
Encryption TLS
Port 587
Auto TLS On
Authentication On
SMTP Username mailkite (any username works)
SMTP Password mk_live_… (your MailKite API key)
From Email you@your-verified-domain.dev Most frameworks (Rails, Laravel, Django, Symfony, Nodemailer, Grafana, Jenkins, Sentry…) read SMTP from environment variables:
SMTP_HOST=smtp.mailkite.dev
SMTP_PORT=587 # STARTTLS · 465 for implicit TLS
SMTP_USER=mailkite # any username works
SMTP_PASS=mk_live_… # your MailKite API key — not a separate SMTP password
SMTP_FROM=you@your-verified-domain.dev Test it from a terminal with swaks:
swaks --server smtp.mailkite.dev:587 --tls \
--auth LOGIN --auth-user mailkite --auth-password "$MAILKITE_API_KEY" \
--from you@your-verified-domain.dev --to you@example.com \
--header "Subject: MailKite SMTP test" --body "It works." Ports & TLS
- 587 (recommended) — submission with STARTTLS. AUTH is only offered after the connection is encrypted, so your key is never sent in the clear.
- 465 — implicit TLS (the connection is encrypted from the first byte). Use this if your client prefers SSL/TLS over STARTTLS.
- Port 25 is not for submission. Most ISPs and clouds block outbound 25 — use 587 or 465.
What lands in your account
Every SMTP send is gated, logged, and stored exactly like an API send: it must
come From a verified domain, it's DKIM-signed and aligned for you,
and it appears in Messages and your logs. SMTP
here isn't a black box — it's the same pipeline with a different front door.
SMTP or the API?
Both run on the same infrastructure, the same domains, and the same sending reputation. Use whichever fits how you build — or use both at once.
| Reach for SMTP when… | Reach for the API + webhooks when… |
|---|---|
| You're plugging in an app, CMS, or CRM that already speaks SMTP | You're building something new and want typed requests and responses |
| The tool only has SMTP settings — no way to add an API call | You want delivery, bounce, and open events pushed to your endpoint |
| You want zero dependencies — no SDK, no lock-in | You want idempotency keys, scheduling, templates, and attachments by URL |
| You want to be sending in minutes with copy-paste settings | You also need inbound email → webhooks — MailKite's core |
Same account, same domains, same keys: start on SMTP today and graduate to the API and webhooks whenever you want more — nothing to migrate.
Troubleshooting
- 535 Authentication failed — the password must be your
mk_live_…API key (any username). Grab or rotate it in the dashboard. - Rejected: outbound_unverified — your
Fromdomain hasn't passed SPF + DKIM yet. Publish the DNS records first. - Connection hangs or times out — you're probably on port 25. Switch to 587 (STARTTLS) or 465 (TLS).
Prefer code? The Send API is one POST away,
and every parameter is in the API reference.