Mailgun to Resend

Migrating from
Mailgun to Resend

Introduction

If you're considering migrating from Mailgun to Resend, you're in the right place.

This guide will help you understand the key differences between the two services and provide you with the necessary steps to make the transition as smooth as possible.

Jump ahead

History

Mailgun and Resend are both email delivery services, but they have different histories and focuses.

Key differences

  • Mailgun was founded in 2010. In September 2021, Sinch acquired Mailgun.
  • Resend was founded in 2023. Resend has a focus on providing a modern developer experience.

Concepts

Both Mailgun and Resend provide user-friendly dashboards for managing your email sending.

Domains

In Mailgun and Resend you need to access the Domains page to verify your domain.

Resend Domains page

Both Mailgun and Resend offer similar authentication features.

NameMailgunResend
DKIMDKIM enforcedDKIM enforced
SPFSPF enforcedSPF enforced
DMARCDMARC not displayedDMARC recommended

Activity Feed

When you send email through Mailgun, sent email is visible on the Dashboard page.

When you send email with Resend, emails are visible on the Emails page.

Resend Emails page

Dashboard

Mailgun shows sending statistics on the Reporting page.

In Resend, statistics are shown on the Metrics page.

Resend Metrics page

Official SDKs

Both Mailgun and Resend provide official SDKs for various programming languages, making them easy to integrate into your application.

Key differences

  • Mailgun does not have official SDKs for Python or Rust.

Send email via API

Both Mailgun and Resend provide a REST API (HTTP) and SDKs for sending emails programmatically.

Key differences

  • Mailgun allows for sending emails as a Template (see docs).
  • Mailgun has a maximum size of 25 MB (see docs).
  • Resend has a maxiumum size of 40 MB (see docs).

Mailgun

const formData = require('form-data');
const Mailgun = require('mailgun.js');
const mailgun = new Mailgun(formData);
const mg = mailgun.client({username: 'api', key: process.env.MAILGUN_API_KEY || 'key-yourkeyhere'});
mg.messages.create('sandbox-123.mailgun.org', {
from: "Excited User <mailgun@sandbox-123.mailgun.org>",
to: ["test@example.com"],
subject: "hello world",
text: "Testing some Mailgun awesomness!",
html: "<h1>Testing some Mailgun awesomness!</h1>"
})
.then(msg => console.log(msg))
.catch(err => console.error(err));

Resend

import { Resend } from 'resend';
const resend = new Resend('re_123456789');
await resend.emails.send({
from: 'Acme <onboarding@resend.dev>',
to: ['delivered@resend.dev'],
subject: 'hello world',
html: '<p>it works!</p>',
});

Send email via SMTP

Both Mailgun and Resend support sending emails via SMTP.

SMTP stands for Simple Mail Transfer Protocol. It is a text-based protocol in which one server communicates with another to send an email.

Key differences

Configurations

  • Mailgun allows for the passing of sending options, like Tags in the SMTP headers (see docs)
  • Mailgun offers the ability to private label the use of Mailgun at an SMTP level via a CNAME record (see docs)
  • Mailgun allows for the creation of a Username and Password based on the domain (see docs).
  • Resend uses a standard value for the Username and the API Key as the Password (see docs).
ConfigurationMailgunResend
Host`smtp.mailgun.org``smtp.resend.com`
Port25, 2525, 587, or 46525, 465, 587, 2465, or 2587
UsernameThe created usernameThe '`resend`' string
PasswordThe created passwordResend API key
AuthenticationPlain text (unencrypted), STARTTLSSMTPS or STARTTLS

Webhooks

Both Mailgun and Resend provide webhooks to notify your application of email events.

Key differences

  • Mailgun has a category called Failure, which happens when emails have both a hard and a soft bounce.
  • Resend has logs of webhook requests, allowing you to see the status of your webhook responses (see docs).

Security & Privacy

Mailgun and Resend both have robust and similar security features.

Key differences

  • Mailgun is HIPAA compliant.
  • Mailgun does not offer Google, or GitHub as authentication methods, while Resend does.
NameMailgunResend
AuthenticationEmail/PasswordEmail/Password, Google, GitHub
Single Sign-OnSSO availableSSO available
Multi-Factor AuthMFA availableMFA available
GDPRGDPR compliantGDPR compliant
SOC 2SOC 2 compliantSOC 2 compliant
HIPAAHIPAA compliant-

Additional Features

Outside of core email sending, Resend offers additional features that Mailgun does not have that may be helpful for you.

No-code editor

The no-code editor makes it easy for anyone to write, format, and send broadcast emails.

Send Marketing Emails with Resend Broadcasts

Enabling anyone to send email campaigns without code.

resend.com/blog/send-marketing-emails-with-resend-broadcasts

Multi-Region

Improve your email deliverability speed by using a region nearest to your users, with options beyond the US and EU.

Faster Email Delivery with Multi-Region

Faster deliverability with reduced latency.

resend.com/blog/multi-region

Pricing

Mailgun and Resend offer competitive pricing based on the number of emails sent.

Key differences

  • Mailgun requires the Scale plan for Dedicated IP usage.
  • Mailgun does not offer SSO on the Basic or Foundation plan (below $90).
EmailsMailgunResend
3,000$0$0
50,000$35$20
100,000$75$35
200,000$215$160
500,000$400$350
1,000,000$700$650
1,500,000$1,250$1,250

Conclusion

Ready to migrate to Resend? Press S to get started. If there's anything else we can help with, contact our team, and we'll answer any questions you have.

Get in touch