Integrations

Heroku

Add reliable SMTP and API email sending, receiving, and analytics to any Heroku app in minutes. No server management required - just provision and start sending from your Heroku dashboard.

Overview

Bring cloud-native email to your Heroku apps. Get a production-ready email solution with a single CLI command. Focus on building your app while Mailgun manages deliverability, inbound parsing, and analytics. Send transactional emails or bulk campaigns. Mailgun scales with your Heroku dynos and keeps messages searchable for 30 days. 

KEY FEATURES AND BENEFITS:

  • SMTP and HTTP API for flexible sending workflows 
  • Real-time inbound email parsing with webhook routing 
  • Built-in address validation to reduce bounces at sign-up 
  • Template management and A/B testing for better engagement 
  • Detailed logs of opens, clicks, bounces, and complaints 
  • Free starter plan with 400 daily messages for development and testing 

Complete email service for Heroku apps with instant provisioning, parsing, and analytics. 

Use Cases

Build, scale, and deliver emails seamlessly

Transactional email automation

Send password resets, confirmations, and receipts instantly with real-time tracking.

Inbound email processing

Route incoming mail to your app to automate support tickets or custom workflows.

Bulk campaign management

Send newsletters or promotions with A/B testing and send-time optimization.

Email validation at sign-up

Verify addresses in real time to reduce bounce rates and protect sender reputation.
Image for Get started in four quick steps

How To Enable The Integration

Get started in four quick steps

Add Mailgun integration to your Heroku app using the CLI and send your first email today.

  • Step 1: Provision the add-on – heroku addons:create mailgun:starter

  • Step 2: Open the dashboard – heroku addons:open mailgun to access credentials

  • Step 3: Add and verify DNS (SPF, DKIM, tracking CNAME) for your sending domain

  • Step 4: Configure your app using the injected MAILGUN_* environment variables to send and receive mail

Why Sinch Mailgun

Why developers choose Sinch Mailgun

Fast to production

Provision email with one CLI command and start testing or shipping features immediately.

Trusted deliverability

SPF, DKIM, and reputation monitoring help your emails reach the inbox.

Developer-first tooling

Clear APIs, webhooks, and SDKs make Mailgun integration with Heroku simple for any stack.

FAQS

Common questions about Mailgun integration with Heroku

Provision the add-on with: 

heroku addons:create mailgun:starter 

Open the dashboard using:

heroku addons:open mailgun   

Environment variables are set automatically. 

The free plan includes 400 messages per day, tracking and analytics, SMTP and HTTP API access, and 1-day log retention. 

Yes. Add SPF, DKIM, and tracking CNAME records as instructed in the dashboard to verify your domain and improve deliverability. 

Yes. You can send outbound mail and parse inbound messages with webhooks that route directly to your app. 

Mailgun manages IP warming, reputation monitoring, and retries, authenticating every message with SPF and DKIM. 

Official libraries are available for Go, Nod.js, PHP, Java, Ruby, and Python. Any language that supports HTTP or SMTP can be used.