# Setting Up Mailgun

**URL:** <https://forum.ghost.org/t/setting-up-mailgun/35723>\
**Category:** Self-hosting\
**Created:** [January 21, 2023, 12:12pm UTC](https://forum.ghost.org/t/setting-up-mailgun/35723 "2023-01-21T12:12:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BarcodeMaker](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/barcodemaker/32/22656_2.png) [@BarcodeMaker](https://forum.ghost.org/u/BarcodeMaker)\
**Post date:** [January 21, 2023, 12:12pm UTC](https://forum.ghost.org/t/setting-up-mailgun/35723/1 "2023-01-21T12:12:29Z")

</div>

How can we use Mailgun service and what is the entire process?

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [January 21, 2023, 2:02pm UTC](https://forum.ghost.org/t/setting-up-mailgun/35723/2 "2023-01-21T14:02:42Z")

</div>

Welcome to the Ghost community, @BarcodeMaker.

Please read the help guides.

> **[Why do I have to set up Mailgun for newsletters?](https://ghost.org/docs/faq/mailgun-newsletters/)**
>
> Sending bulk email to many recipients using SMTP is not supported. In order to send newsletters from Ghost you'll need to setup Bulk Mail with Mailgun.

> **[Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/config/#mail)**
>
> Find out how to configure your Ghost publication or override Ghost's default behaviour with robust config options, including mail, storage, scheduling and more!

---

<div class="post-metadata">

**Author:** ![Detlev](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/detlev/32/24244_2.png) [@Detlev](https://forum.ghost.org/u/Detlev)\
**Post date:** [April 27, 2024, 6:09pm UTC](https://forum.ghost.org/t/setting-up-mailgun/35723/3 "2024-04-27T18:09:30Z")

</div>

I didn’t set up any JSON logic at all, just followed the bouncing ball [instructions] after creating a mailgun account:

1. Set up **DNS records**
2. In **Ghost Admin** v5.x: **Email newsletter** : **Mailgun** settings

… entered my email subdomain and Mailgun API and I was done.

It sends emails upon publishing a fresh newsletter.

1. I received my own email notification about a new publication
2. Ghost admin statistics on emails sends, opens, …
3. Mailgun Statistics on emails having gone out, opened, bounced, spam, …

It took more than 57sec to set up, contrary to Mailgun propaganda, but it works, for now …

… just need to find the correct flow to downgrade to Mailgun’s flex subscription when the time comes.

---

<div class="post-metadata">

**Author:** ![Detlev](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/detlev/32/24244_2.png) [@Detlev](https://forum.ghost.org/u/Detlev)\
**Post date:** [May 15, 2024, 3:50pm UTC](https://forum.ghost.org/t/setting-up-mailgun/35723/5 "2024-05-15T15:50:44Z")

</div>

Just discovered that a user was trying to subscribe and he got an error in regards to getting his magick cookie for login.

BEFORE I’d set up mailgun, my DIRECT email (on my FreeBSD server that means [DragonFly](https://docs.freebsd.org/en/books/handbook/mail/#dragonFly-mail-agent) MTA) function was working as I tested it. It seemed to work after, too … so I don’t know where the disconnect it.

In the end, I did have to set up JSON: `config.production.json` and use mailgun for sending magick cookies … now login works again.

Did anyone else have this experience? Any insights in what I might have missed? Is ghost specifically set up so that once Mailgun is configured for bulk email/newsletters, local MTA is disregarded and must also use Mailgun?

… just curious …
