A transport plugin for Nodemailer that sends emails via Mailgun's REST API instead of SMTP. Version 2.1.5 is stable but receives infrequent updates. It wraps the mailgun-js library to provide a drop-in transport for Nodemailer, enabling easy switching between email providers. Key differentiator: uses HTTP API, avoiding SMTP port blocks and providing better deliverability analytics. Alternative to nodemailer's built-in SMTP transport or other HTTP transports like SendGrid.
npm install nodemailer-mailgun-transportNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Setup Nodemailer with Mailgun transport using API key and domain.
Use async/await or update to a newer version that supports promises.
Switch to @mailgun/mailgun-js or use fetch directly.
Double-check the domain matches your Mailgun sending domain.
Always provide api_key in auth object.
Use {auth: {api_key: 'key', domain: 'domain'}} format.Add api_key: 'your-key' to the auth object.
Run npm install mailgun-js.
Use const mg = require('nodemailer-mailgun-transport') or import mg from '...'.Verify MAILGUN_API_KEY and MAILGUN_DOMAIN environment variables.