To send email from your customers’ own domains, your app adds each customer’s domain to your email provider by API, shows the customer the DNS records to publish, checks until the domain verifies, and then sends their mail from it. Until then, you send from your own domain with their name. Each tenant gets its own credentials, locked to its own domain, so no tenant can ever send as another.
Why send from the customer’s domain?
Booking platforms, invoicing tools, help desks, e-commerce builders and CRMs all send mail on behalf of customers. Sending from bookings@clinic-example.com instead of noreply@yourplatform.com means:
- Recipients recognize the sender and open the email.
- Replies go to the customer naturally.
- DMARC aligns with the domain in the From header, which receivers check.
- One customer’s bad list affects their domain’s reputation more than everyone else’s.
The two-stage approach
| Stage | From | Reply-To | Notes |
|---|---|---|---|
| Before verification | Clinic Example <clinic-example@mail.yourplatform.com> |
hello@clinic-example.com |
Works on day one, passes DMARC on your domain |
| After verification | Clinic Example <bookings@clinic-example.com> |
Optional | Fully branded, aligned with the customer’s domain |
Never put the customer’s domain in the From field before it is verified. It will fail DMARC, and if they publish p=reject, the mail will be refused.
The DNS records customers publish
A typical provider gives each domain:
- DKIM: usually CNAME or TXT records under
_domainkey, so receivers can verify the signature. See DKIM. - Return path: an MX and an SPF TXT record on a sending subdomain such as
send.clinic-example.com, so bounces come back to the provider and SPF aligns. See return path. - DMARC advice: if the domain has no DMARC record, suggest starting with
p=noneand a reporting address.
Because the SPF record goes on a subdomain, the customer’s existing SPF record on the root domain does not change. That avoids pushing them over the SPF 10-lookup limit.
Best practices for multi-tenant sending
- Automate onboarding. A “Send from your domain” page in your app: enter domain, see records, press “Check now”.
- Show records in copyable form, with the exact host names their DNS provider expects. Many providers append the domain automatically, which causes
send.clinic-example.com.clinic-example.com. - Re-check periodically. Records get deleted during DNS migrations.
- Isolate tenants. One key per tenant, locked to their domain. Tag every email with the tenant id.
- Watch per-tenant bounces and complaints. One tenant importing a bad list should be paused by you before it affects everyone.
- Put sending rules in your terms. Your acceptable use obligations pass through to your tenants.
Example tenant email
From: Clinic Example <bookings@clinic-example.com>
Subject: Your appointment on 20 November at 10:30
Hi Sam,
Your appointment with Dr. Lee is confirmed for Thursday 20 November at 10:30.
Address: 4 Example Street, Springfield
Need to change it? https://clinic-example.com/booking/8841
Automating customer domains with Mailcandor
Mailcandor includes unlimited domains on every plan, with no domain fees (see pricing). Adding a domain returns three DKIM CNAMEs, SPF and a bounce MX on send.<domain>, and DMARC advice. If the customer already uses send. for another service, pass custom_return_path with another name, such as bounces.
This script runs when a tenant enters their domain, and again when they press “Check now”:
const API = 'https://api.mailcandor.com/v1';
const admin = {
Authorization: `Bearer ${process.env.MAILCANDOR_KEY}`, // a full-access key
'Content-Type': 'application/json',
};
async function call(method, path, body) {
const res = await fetch(API + path, { method, headers: admin, body: body && JSON.stringify(body) });
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.type}: ${data.error.message}`);
return data;
}
// 1. Tenant enters their domain: add it and show them the records.
export async function addTenantDomain(tenant, name) {
const domain = await call('POST', '/domains', { name });
await saveTenant(tenant.id, { domainId: domain.id, status: domain.status });
return domain.records.map((r) => ({ type: r.type, name: r.name, value: r.value, priority: r.priority, required: r.required }));
}
// 2. Tenant presses "Check now": verify, and create a locked key once verified.
export async function checkTenantDomain(tenant) {
const domain = await call('POST', `/domains/${tenant.domainId}/verify`);
if (domain.status === 'verified' && !tenant.sendKey) {
const key = await call('POST', '/api-keys', {
name: `tenant-${tenant.id}`,
permission: 'sending',
domain_id: domain.id,
});
await saveTenant(tenant.id, { status: 'verified', sendKey: key.token }); // store encrypted
}
return domain.records.map((r) => ({ name: r.name, status: r.status, found: r.found }));
}
saveTenant is your own storage. The found field shows what DNS returned at the last check, which makes “why is it not verifying?” support tickets short. Subscribe to the domain.updated webhook to hear about status changes without polling. If a domain is already on another Mailcandor team, adding it returns 409 domain_taken.
When the tenant’s mail is sent, use their key: it can only send, and only from their domain. A tenant key that leaks cannot send as any other tenant.
Common pitfalls
- Using the customer’s domain before it verifies. DMARC failure, then rejection.
- One shared key for every tenant. A leak, or a bug that mixes up tenants, sends as the wrong brand.
- No per-tenant monitoring. Tag by tenant and watch bounce and complaint rates for each.
- Asking customers to edit their root SPF. Use a provider that puts SPF on a subdomain.
- Forgetting removal. When a tenant leaves, delete their domain so its keys are deleted too.
- Skipping warm-up. A newly verified tenant domain has no sending history. Ramp a large tenant’s volume up over days rather than moving everything on the first afternoon.