Use Mailgun API in settings, SMTP in config, or both?

I’m having trouble setting up email. I am running Ghost v4.12.1, and originally I set up SMTP in config.production.json. When I went to enable Mailgun in settings, I saw it asked for an API key, so I added the information there.

Should I be using both? I tried to send a test email and I got “the server encountered an error.”

My site is at

My config file:

 "mail": {
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "auth": {
        "user": "",
        "pass": "password_here"

The need to setup both is explained here and I will try to summarize it: There are two types of emails.

  1. Transactional : These emails are related to user actions and registrations such as staff invites, member signups, etc. It is configured with the config file (in your case config.production.json). You can use any SMTP server, including Mailgun.
  2. Bulk email : This is for delivery of newsletters . Currently the only bulk mail API supported is Mailgun.You configure this in the Admin Console → Email Newsletter section (where you add the Mailgun API).