Trouble setting up e-mail with Mailgun

I have a brand new site and all tests are fine - new subscribers and logins are working. As soon as I am changing config.production.json to activate Mailgun everything goes down the drain.

This is my code for the SMTP set-up (using Europe/EU mailgun service)

I also activated Mailgun within the Ghost setting using the API key provided by Mailgun. When publishsing a post I can select “sending as newsletter” and I get positive feedback from Ghost. But no mails are being processed by mailgun.

Moreover new subscribers will not be processed as soon as I implement the SMTP info in the config file.

Error log tells me it’s a 401 problem, but I can’t see any connection issues with Mailgun. Any ideas?

here’s mine:

  "mail": {
    "transport": "SMTP",
    "from": "aratherobvioususername@spectralwebservices.com",
    "options": {
      "service": "Mailgun",
      "auth": {
        "user": "snippitysnip@mydomain.com", 
        "pass": "blahblahbalh",
      }
    }
}

I think you’re mixing up the API key directions and the SMTP directions, maybe?

Hi @aufdemweg
we are using the one below with your user and pass :

"mail": {
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.eu.mailgun.org",
      "port": 465,
      "secure": true,
      "auth": {
        "user": "beaugosse@mydomain.com",
        "pass": "yourpass"
      }
    }
  }

I found my mistake. The config set-up is correct, the trouble was in the Ghost setting.

In this box the name of the domain of your website as listed in Mailgun must be entered. And not the smtp…mailgun URL.

Found the hint in this thread https://forum.ghost.org/t/bulk-email-for-new-post-to-free-members-doesnt-work/21730/22

1 Like