# Mail config issue

**URL:** <https://forum.ghost.org/t/mail-config-issue/61227>\
**Category:** Self-hosting\
**Created:** [December 17, 2025, 6:19pm UTC](https://forum.ghost.org/t/mail-config-issue/61227 "2025-12-17T18:19:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanbuckleyca](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanbuckleyca/32/38938_2.png) [@ryanbuckleyca](https://forum.ghost.org/u/ryanbuckleyca)\
**Post date:** [December 17, 2025, 6:19pm UTC](https://forum.ghost.org/t/mail-config-issue/61227/1 "2025-12-17T18:19:19Z")

</div>

Been discussing with Mailgun and it seems the issue isn’t there. Here’s what I’m getting, followed by what I’ve done so far:

Error with transactional email when trying to sign-up a test user to the newsletter:  
POST [https://wevchange.org/members/api/send-magic-link/](https://wevchange.org/members/api/send-magic-link/)  
Response: 500 Internal Server Error  
```  
{  
“errors”: [  
{  
“message”: “Failed to send email. Reason: Sending failed.”,  
“context”: null,  
“type”: “EmailError”,  
“details”: null,  
“property”: null,  
“help”: “Please see [Configuration - Ghost Developer Docs](https://ghost.org/docs/config/#mail) for instructions on configuring email.”,  
“code”: null,  
“id”: “b992da60-db6e-11f0-95e4-cf1f9b02b80c”,  
“ghostErrorCode”: null  
}  
]  
}  
```

I got my API key from [https://app.mailgun.com/settings/api\_security](https://app.mailgun.com/settings/api_security), provided by both Ghost and Mailgun.

I assumed perhaps it was due to SMTP configuration (but I assume newsletter signup is through the API…maybe it was failing due to a transactional email not sending?) So gathered the SMTP config from Mailgun, made sure to use the subdomain, and added those to the config.local.json file for production.

I restarted, still same result. Anyone know what’s going on?

(Using Northflank for prod)

---

<div class="post-metadata">

**Author:** ![KBExit](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kbexit/32/38359_2.png) [@KBExit](https://forum.ghost.org/u/KBExit)\
**Post date:** [December 17, 2025, 8:25pm UTC](https://forum.ghost.org/t/mail-config-issue/61227/2 "2025-12-17T20:25:44Z")

</div>

Ghost uses SMTP for transactional emails and the newsletters themselves go through the API in your settings. I suggest running ghost in a docker compose instance and including your SMTP credentials to the .env file. I suggest this as Ghost is moving in this direction as the official method of selfhosting. This will mitigate future migrations.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [December 17, 2025, 8:48pm UTC](https://forum.ghost.org/t/mail-config-issue/61227/3 "2025-12-17T20:48:53Z")

</div>

Could you please share your Ghost config.production.json, or the docker compose, redacting secrets? I suspect you’ve configured newsletters but not transactional email. You absolutely can send transactional email via Mailgun API (and it can be more reliable than using SMTP, which your host might block), but you do have to configure it.

---

<div class="post-metadata">

**Author:** ![ryanbuckleyca](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanbuckleyca/32/38938_2.png) [@ryanbuckleyca](https://forum.ghost.org/u/ryanbuckleyca)\
**Post date:** [December 17, 2025, 9:37pm UTC](https://forum.ghost.org/t/mail-config-issue/61227/4 "2025-12-17T21:37:38Z")

</div>

If it could all be through the API that’d be great. Here’s the config redacted:

```auto
{

“url”:null,

“server”:{

“port”:2368,

“host”:“0.0.0.0”

},

“security”:{

“staffDeviceVerification”:false

},

“logging”:{

“transports”:[“file”,“stdout”]

},

“process”:“systemd”,

“paths”:{

“contentPath”:“/var/lib/ghost/content”

},

“database”:{

“client”:“mysql2”,

“connection”:{

“host”:“{REDACTED}”,

“port”:3306,

“user”:“{REDACTED}”,

“password”:“{REDACTED}”,

“database”:“{REDACTED}”,

“ssl”:{}

}

},

“mail”:{

“transport”:“SMTP”,

“options”:{

“host”:“smtp.mailgun.org”,

“port”:587,

“secure”:false,

“auth”:{

“user":"name@subdomain.ourdomain.org”,

“pass”:“{REDACTED}”

  }

},

“from”:“{SAME AS ABOVE}”

}

}

```

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [December 18, 2025, 12:02am UTC](https://forum.ghost.org/t/mail-config-issue/61227/5 "2025-12-18T00:02:55Z")

</div>

API-based example here: [Make onboarding emails also work via API (not only SMTP)](https://forum.ghost.org/t/make-onboarding-emails-also-work-via-api-not-only-smtp/56426)

---

<div class="post-metadata">

**Author:** ![ryanbuckleyca](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanbuckleyca/32/38938_2.png) [@ryanbuckleyca](https://forum.ghost.org/u/ryanbuckleyca)\
**Post date:** [December 18, 2025, 4:14pm UTC](https://forum.ghost.org/t/mail-config-issue/61227/6 "2025-12-18T16:14:59Z")

</div>

OK some progress, but now getting “Unknown Content API Key” from `/settings`, `/tiers`, and `/newsletters` after `/member` now 204s successfully

 ![Screenshot 2025-12-18 at 11.47.43 AM](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/0/f/0f93cd672b84ad616c9d48b1dd0c7e91998c8f83.png)

I saw someone saying you have to use the mail send API, not the general API, but that didn’t work either

---

<div class="post-metadata">

**Author:** ![ryanbuckleyca](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanbuckleyca/32/38938_2.png) [@ryanbuckleyca](https://forum.ghost.org/u/ryanbuckleyca)\
**Post date:** [December 18, 2025, 4:59pm UTC](https://forum.ghost.org/t/mail-config-issue/61227/7 "2025-12-18T16:59:12Z")

</div>

Which API key is this? Would the config override this or are both necessary?

 ![Screenshot 2025-12-18 at 11.58.39 AM](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/d/a/dada8b12a126ae8cab65315a301c6a7c638fd4f1.png)
