# Error sending email, authentication required

**URL:** <https://forum.ghost.org/t/error-sending-email-authentication-required/8194>\
**Category:** Installation\
**Created:** [July 9, 2019, 12:53pm UTC](https://forum.ghost.org/t/error-sending-email-authentication-required/8194 "2019-07-09T12:53:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Melon\_Marauda](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/melon_marauda/32/3182_2.png) [@Melon\_Marauda](https://forum.ghost.org/u/Melon_Marauda)\
**Post date:** [July 9, 2019, 12:53pm UTC](https://forum.ghost.org/t/error-sending-email-authentication-required/8194/1 "2019-07-09T12:53:41Z")

</div>

Hi I have recently decided to invest a bit of time in installing ghost on a VPS to see how it works and then to create a site with it. Everything has been successful up until the point of inviting new staff via email. I have done a bit of research through other topics and forums and I can’t seem to find anyone who is having quite the same issue.  
The current error I am receiving is:

 ![ghost1](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/7/78330e9021114272b2730ca59ad10cd30773fea9.png)  
Originally I was having another error which suggested I had entered the wrong username and password but now I just get this error, over and over again. I changed my email settings, purposefully put in the wrong username, password or port to see if a different error occurs like I was having before but this is the only error I get now.  
My email settings are:

```
"mail": {
 "transport": "SMTP",
 "options": {
    "service": "Mailgun",
    "host": "smtp.mailgun.org",
    "port": 2525,
    "secureConnection": true,
    "auth": {
      "user": "user",
      "password": "pass"
    }
  }
},   

```

The only thing I can think of that I have not tried yet is reinstalling ghost since I have done some work on the site and don’t want to lose that. But I will try reinstalling if that’s the only solution available.  
Cheers

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [July 9, 2019, 1:38pm UTC](https://forum.ghost.org/t/error-sending-email-authentication-required/8194/2 "2019-07-09T13:38:01Z")

</div>

Here’s the mailgun configuration I use that works:

```json
 "mail": {
    "transport": "SMTP",
    "from": "Robot Overlord <from@example.com>",
    "options": {
      "service": "mailgun",
      "auth": {
        "user": "from@example.com",
        "pass": "heheh"
      }
    }
  }

```

I suggest trying this first, and then attempting to secure the connection

---

<div class="post-metadata">

**Author:** ![Melon\_Marauda](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/melon_marauda/32/3182_2.png) [@Melon\_Marauda](https://forum.ghost.org/u/Melon_Marauda)\
**Post date:** [July 9, 2019, 3:19pm UTC](https://forum.ghost.org/t/error-sending-email-authentication-required/8194/3 "2019-07-09T15:19:23Z")

</div>

Doesn’t change anything, still the same error. My guess is that there’s something wrong with the installation since seemingly no matter what I change the error stays the same.

---

<div class="post-metadata">

**Author:** ![kmutahar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kmutahar/32/3252_2.png) [@kmutahar](https://forum.ghost.org/u/kmutahar)\
**Post date:** [July 9, 2019, 5:51pm UTC](https://forum.ghost.org/t/error-sending-email-authentication-required/8194/4 "2019-07-09T17:51:30Z")

</div>

So I had the same problem what ended up being the issue is that I had to use a different port try changing it to port 465. Also you need to double check that you have your domain on the correct [region](https://www.mailgun.com/regions) Default is the US if you didnt change it . so if you domain is in the US the host will be `smtp.mailgun.org` if its the EU it will be `smtp.eu.mailgun.org`

Below is what I personaly have in the config ile

```auto
  "mail": {
    "from": "'Ghost Server' <ghost@example.com>",
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.eu.mailgun.org",
      "port": 465,
      "secureConnection": true,
      "auth": {
        "user": "ghost@example.com",
        "pass": "PASSWORD"
      }
    }
  },

```

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [July 9, 2019, 5:53pm UTC](https://forum.ghost.org/t/error-sending-email-authentication-required/8194/5 "2019-07-09T17:53:49Z")

</div>

The installation being an issue, while possible, is usually not probable. Checking the obvious things, are you restarting your instance after making configuration changes?

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [July 9, 2019, 7:51pm UTC](https://forum.ghost.org/t/error-sending-email-authentication-required/8194/6 "2019-07-09T19:51:37Z")

</div>

The original config you shared had “password” as a key, instead of just “pass”.

The error reads “Authentication required” because according to mailgun, you hadn’t provided authentication (the `pass` field was missing).

Make sure that you run `ghost restart` in between all changes. After changing password to pass and restarting, you _should_ in theory get a different error message if there still is one.

As has been said, reinstalling is unlikely to help, this is almost certainly a nuance of configuration.

---

<div class="post-metadata">

**Author:** ![Melon\_Marauda](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/melon_marauda/32/3182_2.png) [@Melon\_Marauda](https://forum.ghost.org/u/Melon_Marauda)\
**Post date:** [July 10, 2019, 1:01am UTC](https://forum.ghost.org/t/error-sending-email-authentication-required/8194/7 "2019-07-10T01:01:10Z")

</div>

Thankyou! It was just that I had it as “password” rather than “pass” and yeah I had been restarting inbetween updates to the config. So frustrating that I missed something so simple, but thanks!
