Skip to main content

Migrating from Mailgun to Mailofly

Mailgun has been a legacy email provider for over a decade, but modern teams often find its multipart/form-data API design awkward, its domain-scoped URL paths clunky (/v3/DOMAIN_NAME/messages), and its billing tiers unpredictable. Mailofly simplifies email sending with clean REST JSON endpoints, typed modern SDKs, predictable pricing, and instant real-time logs.

Key Differences at a Glance


1. Code Comparison

Node.js / TypeScript


Python


cURL


2. Migrating Suppressions (Bounces & Complaints)

Mailgun tracks three suppression lists:
  1. Bounces: /v3/{domain}/bounces
  2. Unsubscribes: /v3/{domain}/unsubscribes
  3. Complaints: /v3/{domain}/complaints

Export from Mailgun

  1. Log in to the Mailgun control panel.
  2. Go to Sending → Suppressions.
  3. Select your domain and download the CSVs for Bounces, Unsubscribes, and Complaints.

Import into Mailofly

  1. In Mailofly, navigate to Audiences > Contacts.
  2. Click Import CSV.
  3. Select your suppression files and check Mark as Suppressed / Unsubscribed.
  4. Mailofly will ensure no further emails are dispatched to these addresses.

3. Webhook Migration

Mailgun requires calculating an HMAC-SHA256 digest on timestamp + token using your Mailgun signing key. Mailofly uses standard Svix / HMAC webhooks.

Event Name Mapping


Migration Checklist

  • Add domain to Mailofly and configure DKIM (mailofly._domainkey) and SPF.
  • Add include:mailofly.com to your domain SPF record.
  • Export Mailgun Bounces, Complaints, and Unsubscribes, and import into Mailofly.
  • Update client application code from multipart/form-data to @mailofly/node JSON calls.
  • Configure Mailofly webhook URLs for delivery and bounce tracking.
  • Verify test emails on the Mailofly dashboard.
  • Remove Mailgun MX and SPF records after the transition is complete.