To migrate from Mailgun, run both providers side by side for a short while: export your suppression lists, verify your domain with the new provider, change the send call, map webhooks and inbound routes, then move traffic over in steps. Do not delete anything at Mailgun until the new setup has carried real traffic for a few days.
This guide uses Mailcandor as the destination, but the steps apply to any email API.
Before you start: a migration checklist
| Item at Mailgun | What to do |
|---|---|
| Bounces, unsubscribes, complaints | Export them and keep sending to them blocked |
| Sending domain DNS | Add the new provider’s records alongside Mailgun’s |
Send call (/v3/{domain}/messages) |
Replace with the new API or SMTP settings |
| Stored templates | Render in your app |
| Webhooks | Map event names, point them at the same handler |
| Inbound routes | Move MX records, or keep inbound at Mailgun for now |
Scheduled sends (o:deliverytime) |
Use the new provider’s scheduling |
| Tags and custom variables | Map to tags or metadata |
Step 1: export your suppression lists
Mailgun keeps lists of addresses that bounced, unsubscribed or complained. If you skip this step, your first sends from the new provider will hit those addresses again, and your bounce and complaint rates will spike at exactly the moment your new provider is learning who you are. Export all three lists from the Mailgun dashboard or API, store them in your own database, and check them before every send until the new provider has built its own suppression history.
Step 2: verify your domain with the new provider
Add your domain in Mailcandor. You get three DKIM CNAME records, an SPF record and a bounce MX on send.<domain>, plus DMARC advice. Add them alongside Mailgun’s records. Both can usually coexist, because each provider’s DKIM keys live under their own selectors. The one clash to check: if your Mailgun sending domain was send.<domain>, the bounce MX records will collide, so plan that change for cut-over day.
If your DMARC policy is quarantine or reject, check that test messages from the new provider pass DMARC before you move real traffic. Our SPF, DKIM and DMARC guide explains the records.
Step 3: replace the send call
Mailgun’s API takes form-encoded fields with HTTP Basic auth (username api, your key as password), as shown in Mailgun’s sending docs. A typical call looks like this:
// Before: Mailgun
const form = new FormData();
form.append('from', 'Acme <hello@acme.com>');
form.append('to', 'sam@example.com');
form.append('subject', 'Your receipt');
form.append('html', '<p>Thanks for your order.</p>');
form.append('o:tag', 'receipt');
await fetch('https://api.mailgun.net/v3/acme.com/messages', {
method: 'POST',
headers: {
Authorization: 'Basic ' + Buffer.from(`api:${process.env.MAILGUN_KEY}`).toString('base64'),
},
body: form,
});
The same email through Mailcandor is JSON with a bearer token:
// After: Mailcandor
const res = await fetch('https://api.mailcandor.com/v1/emails', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MAILCANDOR_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': 'order-1042-receipt',
},
body: JSON.stringify({
from: 'Acme <hello@acme.com>',
to: 'sam@example.com',
subject: 'Your receipt',
html: '<p>Thanks for your order.</p>',
tags: [{ name: 'type', value: 'receipt' }],
}),
});
if (!res.ok) {
const { error } = await res.json();
throw new Error(`${error.type}: ${error.message}`);
}
const { id } = await res.json();
Field mapping:
| Mailgun | Mailcandor |
|---|---|
from, to, cc, bcc, subject, text, html |
Same names, in JSON. to can be a string or a list |
h:Reply-To |
reply_to |
h:X-Anything |
headers: { "X-Anything": "..." } |
o:tag |
tags: [{ name, value }] |
attachment (file upload) |
attachments: [{ filename, content }] with base64 content |
o:deliverytime (up to 3 days, or 7 on some plans) |
scheduled_at, up to 30 days, ISO date or text such as “in 2 hours” |
recipient-variables batch |
POST /v1/emails/batch, up to 100 emails per request |
template, t:variables |
Not supported: render HTML in your app |
If your app sends through Mailgun’s SMTP instead, change four settings: host smtp.mailcandor.com, port 465 (TLS) or 587 (STARTTLS), username mailcandor, password your API key. See SMTP relay.
Step 4: map webhook events
Mailgun’s webhook events are accepted, delivered, temporary_fail, permanent_fail, opened, clicked, unsubscribed and complained. Map them like this:
| Mailgun | Mailcandor |
|---|---|
accepted |
email.sent |
delivered |
email.delivered |
temporary_fail |
email.delivery_delayed |
permanent_fail |
email.bounced (or email.failed) |
complained |
email.complained |
opened, clicked |
email.opened, email.clicked |
unsubscribed |
No direct equivalent: Broadcasts handle one-click unsubscribe for marketing mail |
Mailcandor signs webhooks with the Standard Webhooks scheme, so replace Mailgun’s signature check with a Standard Webhooks verifier. Failed deliveries are retried up to 8 times over about 28 hours and can be replayed. See webhooks.
Step 5: move inbound routes
If you use Mailgun routes to receive mail, point the receiving domain’s MX record at inbound-smtp.us-east-1.amazonaws.com. Each message then fires an email.received webhook and can be read with GET /v1/emails/receiving, attachments included. Inbound is on every Mailcandor plan. Use a subdomain such as reply.acme.com if your main domain’s MX must keep pointing at your mailbox provider.
Step 6: cut over gradually
- Send internal and test mail through the new provider for a day.
- Move one low-risk stream, such as notifications, and watch bounces, complaints and inbox placement.
- Move the rest over several days, keeping volume per day similar to what Mailgun was sending.
- Keep Mailgun live, but idle, for a week in case you need to roll back.
- Remove Mailgun’s DNS records and cancel the plan.
What to check before choosing a destination
Compare data location, inbound limits, log retention and price at your volume. Mailgun’s own numbers, from mailgun.com/pricing (checked 16 November 2026): Foundation 50k is $35 a month and Foundation 100k is $75. Our Mailgun pricing guide has the full table. For comparison, Mailcandor’s Team plan is $39 a month with 100,000 emails included, and Pay as you go is $0.50 per 1,000 after the first 3,000. Access is currently by request on the pricing page.