ActiveCampaign + MailKite
ActiveCampaign is a marketing automation and CRM platform. Use MailKite's SMTP for transactional email and ActiveCampaign for marketing sequences, or receive inbound email to trigger automations.
What you need
- A verified domain with SPF + DKIM published
- Your API key (
mk_live_…) - ActiveCampaign account with API access
Send email
Use MailKite SMTP for transactional email. ActiveCampaign handles marketing sequences and automations.
smtp-config
# ActiveCampaign → Settings → Email SMTP
# Or configure in your app:
SMTP Host: smtp.mailkite.dev
SMTP Port: 587
SMTP Username: mailkite
SMTP Password: mk_live_...
From: hello@yourdomain.com Receive inbound email (optional)
Point your domain's webhook to this handler. Inbound email adds the contact and triggers an ActiveCampaign automation.
handle-inbound.ts
// Receive inbound email → trigger ActiveCampaign automation
const AC_API = 'https://youraccount.api-us1.com/api/3';
async function handleInbound(email) {
// Add or update contact
const contactRes = await fetch(`${AC_API}/contacts`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Api-Token': process.env.AC_API_TOKEN,
},
body: JSON.stringify({
contact: {
email: email.from,
firstName: email.from.split('@')[0],
},
}),
});
const contact = await contactRes.json();
// Trigger automation via webhook
await fetch(`${AC_API}/automations/${process.env.AC_AUTOMATION_ID}/trigger`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Api-Token': process.env.AC_API_TOKEN,
},
body: JSON.stringify({
contact: { id: contact.contact.id },
eventData: { subject: email.subject, body: email.text },
}),
});
return { ok: true };
} Test it
terminal
curl -X POST https://your-worker.example.com/mailkite-inbound \
-H "Content-Type: application/json" \
-d '{"from":"subscriber@example.com","to":"hello@yourdomain.com","subject":"Unsubscribe request","text":"Please remove me."}' Troubleshooting
- API tokens are under Settings → Developer → API Access.
- Automations must have a webhook trigger configured before they can be triggered programmatically.
- The
api-us1subdomain varies by account region — check your ActiveCampaign URL.
See the SMTP relay docs for the full connection reference, or all integrations for other platforms.