# SMTPAuthenticationError - I don't receive mail from mailgun to setup the admin account

**URL:** https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608
**Category:** Self-hosting
**Created:** [December 12, 2022, 12:42am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608 "2022-12-12T00:42:34Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![DiscourseUser](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DiscourseUser](https://meta.discourse.org/u/DiscourseUser)
#### Post date: [December 12, 2022, 12:42am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/1 "2022-12-12T00:42:34Z")

</div>

Hello, I’ve been trying to set up my Discourse forum, everything is fine except that I won’t get any mail for the admin account when trying to set it up.  
I use mailgun, and everything is fine on that end in the DNS settings, with it showing “active” or “verified” in green colors on all the settings.  
Checking the logs on mailgun it doesn’t show anything either.

I ran ./discourse-doctor and this is what it shows:

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/9/a/d9a9eb2515515f40ef334f1ac7cc798c6e91c8a6.png)

Does anyone know what I can do?

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [December 12, 2022, 1:05am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/2 "2022-12-12T01:05:32Z")

</div>

Hi,  
you’ll find some useful hint here: [Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326)  
Some port issue maybe [are-your-smtp-connections-being-blocked-4](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326#are-your-smtp-connections-being-blocked-4) ?

---

<div class="post-metadata">

### Author: ![DiscourseUser](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DiscourseUser](https://meta.discourse.org/u/DiscourseUser)
#### Post date: [December 12, 2022, 1:20am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/3 "2022-12-12T01:20:38Z")

</div>

I’ve tried solutions there and I’m kinda stuck, I even did a rebuild to make sure I didnt spell anything wrong, but I copy pasted everything during my setup to make sure I wouldn’t misspell anything.

This is the message I get when checking the port:  
 ![image](https://global.discourse-cdn.com/meta/original/4X/e/3/b/e3be928a5251c8bb365c9b992fcf0eb7441dc405.png)

---

<div class="post-metadata">

### Author: ![crcoli7307](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/crcoli7307/32/267901_2.png) [@crcoli7307](https://meta.discourse.org/u/crcoli7307)
#### Post date: [December 12, 2022, 1:31am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/4 "2022-12-12T01:31:07Z")

</div>

Are you attempting to hosting this forum in the cloud, if so, which provider are you using? They may be blocking the requests.

---

<div class="post-metadata">

### Author: ![DiscourseUser](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DiscourseUser](https://meta.discourse.org/u/DiscourseUser)
#### Post date: [December 12, 2022, 1:33am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/5 "2022-12-12T01:33:12Z")

</div>

I’m hosting it on digitalocean with the discourse 1 click app.

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [December 12, 2022, 1:34am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/6 "2022-12-12T01:34:17Z")

</div>

🤔 could you try to authenticate  
create a base64 encoded string

```plaintext
echo -ne '\0username\0password' | base64

```

then

```plaintext
openssl s_client -connect smtp.mailgun.com:587 -starttls smtp

```

and

```plaintext
AUTH PLAIN withthebase64stringfromabove

```

---

<div class="post-metadata">

### Author: ![crcoli7307](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/crcoli7307/32/267901_2.png) [@crcoli7307](https://meta.discourse.org/u/crcoli7307)
#### Post date: [December 12, 2022, 1:35am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/8 "2022-12-12T01:35:27Z")

</div>

I take that back. It did initialize a connection to mailgun.

---

<div class="post-metadata">

### Author: ![DiscourseUser](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DiscourseUser](https://meta.discourse.org/u/DiscourseUser)
#### Post date: [December 12, 2022, 1:36am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/9 "2022-12-12T01:36:38Z")

</div>

Where do I do this? I’m sorry I’m not a coder, just literally followed this youtube tutorial lol.

[![](https://global.discourse-cdn.com/meta/original/3X/2/8/280e17722dd7672905ac0aadb3233bcccb65c512.jpeg "How To Install Discourse Forum Using a Digital Ocean One-Click Server") ](https://www.youtube.com/watch?v=UU-o2Zsq3Ag)

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [December 12, 2022, 1:38am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/10 "2022-12-12T01:38:30Z")

</div>

> [@DiscourseUser](#):
>
> discourse 1 click app.

oh…

> [@Digitalocean 1-click Discourse install](https://meta.discourse.org/t/digitalocean-1-click-discourse-install/176181/2):
>
> I think DO one click is not a community-supported setup. I think you should reset your droplet instead and go ahead with this one.

[standard install](https://meta.discourse.org/t/142537?silent=true)

---

<div class="post-metadata">

### Author: ![DiscourseUser](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DiscourseUser](https://meta.discourse.org/u/DiscourseUser)
#### Post date: [December 12, 2022, 1:47am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/11 "2022-12-12T01:47:21Z")

</div>

I see, I mean I’ve done it before successfully with the “1 click app” 2 years ago for another forum, and the only thing that I have trouble with right now is the email not going through ☹ seems rather excessive to do it the hard way which I probably can’t anyways with this minor issue

---

<div class="post-metadata">

### Author: ![DiscourseUser](https://avatars.discourse-cdn.com/v4/letter/d/74df32/32.png) [@DiscourseUser](https://meta.discourse.org/u/DiscourseUser)
#### Post date: [December 12, 2022, 1:57am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/12 "2022-12-12T01:57:24Z")

</div>

Sorry I pasted the wrong youtube video, I updated previous post but this is the one:

[![](https://global.discourse-cdn.com/meta/original/3X/2/8/280e17722dd7672905ac0aadb3233bcccb65c512.jpeg "How To Install Discourse Forum Using a Digital Ocean One-Click Server") ](https://www.youtube.com/watch?v=UU-o2Zsq3Ag)

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [December 12, 2022, 2:00am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/13 "2022-12-12T02:00:09Z")

</div>

> [@DiscourseUser](#):
>
> seems rather excessive to do it the hard way

Ah yes, I understand the dilemma, but I’ve found the exercise quite rewarding down the road and on the other hand it’s very difficult if not impossible to follow every customization done in these 1’click installs so support is very difficult.  
But you can try to see what’s wrong with the shell commands above in a terminal and find out what is missing from the host system.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 12, 2022, 2:30am UTC](https://meta.discourse.org/t/smtpauthenticationerror-i-dont-receive-mail-from-mailgun-to-setup-the-admin-account/248608/14 "2022-12-12T02:30:34Z")

</div>

See [Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326)
