SMTP relay
Most tools can send through an SMTP server even when they can't call an API: Supabase Auth, Ghost, WordPress, Discourse, Keycloak, n8n, Django, Rails, Laravel. Point them at Kula and their emails leave from your verified domain, as transactional emails of your space.
Connection settings
| Host | smtp.kulamail.com |
| Port | 587 or 2587 with STARTTLS, 465 or 2465 with TLS |
| Username | kula with a space key, or the space id with an account key |
| Password | An API key of the space |
| Authentication | PLAIN or LOGIN |
- TLS is required, version 1.2 at least. On
587and2587, the client must sendSTARTTLSbefore logging in. - Use
2587or2465when your host blocks the usual SMTP ports, as DigitalOcean and some platforms do. - Port
25is not open.
Settings › SMTP shows these settings for your space.
Authentication
Create a key in Settings › API keys. A key with sending access is enough, and safer to paste into a tool. API keys.
| Key | Username |
|---|---|
Space key (ml_…) | kula |
| Account key | The id of the space to send from |
A revoked key stops working within 60 seconds. After 10 failed logins in 10 minutes, an IP is refused for 15 minutes.
What Kula does with an email
Each email is sent as if your tool called POST /v1/emails/batch with your key: same checks, same rate limits, same suppression list.
| Becomes | |
|---|---|
Envelope recipients (RCPT TO) | One email per recipient, Bcc included |
From | The sender. It must use a verified domain of the space. Without it, the default sender of the space |
Reply-To | Where replies go (the first address) |
Subject | The subject |
text/html and text/plain parts | The content, sent as given. Without a plain-text part, Kula derives one |
In-Reply-To, References, X-* headers | Kept, 20 at most, except X-SES-* and X-Mailler-*, dropped |
X-Kula-Tag-<name>: <value> headers | Tags |
X-Kula-Track header | Tracking |
The envelope sender (MAIL FROM) is ignored: bounces go to Kula, through the MAIL FROM domain of your space.
One email per recipient
Each recipient gets their own copy, with only their address in To. An email to three people in To and Cc becomes three separate emails, and none of them shows the other recipients. Each one has its own status, activity and webhooks, and counts as one email.
Tags
Add headers named X-Kula-Tag-<name> to tag the email, 20 at most. Names are lowercased.
X-Kula-Tag-User-Id: usr_1042
X-Kula-Tag-Kind: password-reset
They come back as {"user-id": "usr_1042", "kind": "password-reset"} in the activity and every webhook about the email, and filter the stats.
Tracking
Emails are not tracked unless you ask. Add an X-Kula-Track header with opens, clicks or both:
X-Kula-Track: opens, clicks
Values are comma separated and case-insensitive; unknown values are ignored. Like X-Kula-Tag-*, the header is not sent with the email.
Duplicates
If your tool loses the connection after sending an email and sends it again, Kula recognizes it by its Message-ID and does not send it twice. Most tools set a Message-ID; without one, a resent email is sent again.
Limits
| Limit | |
|---|---|
| Email size | 10 MB |
| HTML and text content | 1 MB each |
| Recipients per email | 50. Clients send the rest in another transaction |
| Connections per IP | 20 at once |
| Idle connection | Closed after 2 minutes |
Each email counts as one request in the rate limits of the key.
Response codes
| Code | Meaning | What to do |
|---|---|---|
250 | Queued. The answer gives the email id | Nothing |
530 | Login before STARTTLS | Enable STARTTLS, or use port 465 |
535 | Wrong username or key, or account suspended | Check the username (kula) and the key |
554 5.6.0 | Attachment, or no readable content | Send without attachments |
554 5.7.1 | Refused: sender outside a verified domain, missing subject, content too large, revoked key | Read the message, fix and resend |
554 5.7.0 | Monthly limit of your plan reached | Billing |
451 4.7.1 | Rate limit, or the daily SMTP limit before approval | Your tool retries later |
451 4.3.0 | Temporary error on our side | Your tool retries later |
452 | Over 50 recipients | Your tool sends the rest separately |
421 | Too many connections, or too many failed logins | Wait and reconnect |
When some recipients of an email are refused, the answer is the first refusal. Resend the whole email: recipients already accepted are not sent twice.
Test mode
Use a key of a test space (ml_test_…): nothing is delivered, every email appears in Activity with its content. Send to bounced@test.kulamail.com or complained@test.kulamail.com to see how your tool and webhooks react.
Not supported
- Attachments and inline images: refused with
554, never sent without them. Link to the file instead. Attachments are planned. - Templates and variables: send the final content, or use the API with a template.
- Newsletters and campaigns: the relay sends transactional emails only. They have no unsubscribe header. Send newsletters as campaigns.
- Receiving email: replies go to your
Reply-Toaddress, not to Kula.
Before account approval
Until your account is approved, SMTP and the API send at most 50 emails a day to people outside your team, all spaces together, test spaces excluded. Emails to the members of your account don't count. Beyond, emails are refused with 451 4.7.1 until midnight UTC; most tools keep them and retry.
Owners and admins get an email at 40 and when the limit is reached. Approval lifts the limit.
Bounces and complaints
Kula never sends bounce emails back to your tool. Follow bounces and complaints in Activity, or with the email.bounced and email.complained webhooks. An email from SMTP shows Sent via SMTP in its details.