Post's email working, but not the invites with Mailgun

Hello everyone,

I’ve issues with registering, more generally with all invites.
I set up Mailgun for the SMTP, and it works correctly when I send posts as an email. I receive them.

But when I try to invite a new person (staff or member), or that a user wants to register, I have the same problem. The

  • Url:

  • Version: Ghost-CLI version: 1.17.3 / Ghost version: 4.13.0

  • What browser: Chrome and Firefox (I didn’t check on others)

  • Configuration

  "url": "",
  "server": {
    "port": 2369,
    "host": ""
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "--------",
      "password": "-------",
      "database": "--------"
  "mail": {
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "auth": {
        "user": "",
        "pass": "------------------------------"
  "logging": {
    "transports": [
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/"
  • What errors or information do you see in the console?
    On both calls (/members/api/send-magic-link/ and /ghost/api/canary/admin/invites/), I get the same error 504 with the message : 504 Gateway Time-out
    But I set Mailgun as SMTP, isn’t it supposed to use it ?
    I’m a little confused there…

  • What steps could someone else take to reproduce the issue you’re having?
    You can register on the form to get the error message after 1 minute.

1 Like


My mailgun config look like this:

  "mail": {
    "from": "'' <>",
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "",
      "port": 465,
      "secureConnection": true,
      "auth": {
        "user": "MY USERNAME",
        "pass": "MYPASSWORD"


Thanks for your help!

I tried your configuration, but I still have the same error.

Did I miss something on the Nginx configuration or on my server ?



I’m sorry, but i have no idea :frowning:

Pour ceux qui sont sur Scaleway, je viens d’avoir la solution, il faut activer l’option des SMTP sur le serveur :slight_smile: