# Issues troubleshooting email

**URL:** https://meta.discourse.org/t/issues-troubleshooting-email/116016
**Category:** Self-hosting
**Created:** [April 25, 2019, 10:03pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016 "2019-04-25T22:03:58Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![MST2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mst2/32/139354_2.png) [@MST2](https://meta.discourse.org/u/MST2)
#### Post date: [April 25, 2019, 10:03pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/1 "2019-04-25T22:03:58Z")

</div>

So, I have installed Discourse and I am having issues with the email.  
I‘m using SparkPost and followed [this](https://www.sparkpost.com/docs/integrations/discourse/) guide.  
Now I used the troubleshoot guide, and at the part where you‘re supposed to check the discourse logs is where I‘m at right now. I looked at them and found this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/c/2cd630d3e9ea1d48a591fd5943cc5ef0dd4cbc65.jpeg)  
Now, I understand this as an email was sent but something is not known or failed?  
Could someone help me?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 25, 2019, 10:17pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/2 "2019-04-25T22:17:02Z")

</div>

Where did you install Discourse?

Is DNS working correctly? Can you resolve the mail server address from the server?

---

<div class="post-metadata">

### Author: ![MST2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mst2/32/139354_2.png) [@MST2](https://meta.discourse.org/u/MST2)
#### Post date: [April 25, 2019, 10:19pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/3 "2019-04-25T22:19:42Z")

</div>

I installed discord on a cloud server.

What exactly do you mean with _can you resolve the mail server address from the server_?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 25, 2019, 10:20pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/4 "2019-04-25T22:20:33Z")

</div>

I mean can you use PING or NSLOOKUP to resolve the address you entered during `discourse-setup` for sparkpost?

Did you follow the [standard install guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)? How did you install Discourse onto the server?

---

<div class="post-metadata">

### Author: ![MST2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mst2/32/139354_2.png) [@MST2](https://meta.discourse.org/u/MST2)
#### Post date: [April 25, 2019, 10:26pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/5 "2019-04-25T22:26:05Z")

</div>

> [@Stephen](#):
>
> address you entered during discourse-setup for sparkpost.

The STMP address from SparkPost?

> [@Stephen](#):
>
> Did you follow the [standard install guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)? How did you install Discourse onto the server?

I did everything like in the guide. I installed it with docker.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 25, 2019, 10:31pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/6 "2019-04-25T22:31:31Z")

</div>

The address of the SMTP server, which is a DNS name, not the SMTP address sparkpost is using, which would be in the format [user@realm.com](mailto:user@realm.com)

---

<div class="post-metadata">

### Author: ![MST2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mst2/32/139354_2.png) [@MST2](https://meta.discourse.org/u/MST2)
#### Post date: [April 25, 2019, 10:35pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/7 "2019-04-25T22:35:17Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/5/b/5b2717670c1ba9e9ea8c73501b65cd4aaa0b7d2c.jpeg) ![image](https://global.discourse-cdn.com/meta/original/3X/d/d/dd70c97c8729255fbfc3847bb6d45687ed2acd96.jpeg)  
Anything here?  
(Sorry if this is hard..)

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 25, 2019, 10:37pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/8 "2019-04-25T22:37:31Z")

</div>

So

SSH into your server and do this:

`ping smtp.sparkpostmail.com`

Also, if you:

`cat /var/discourse/containers/app.yml | grep "smtp.sparkpostmail.com"`

What’s the response?

If you don’t get back a line like this:

`DISCOURSE_SMTP_ADDRESS: smtp.sparkpostmail.com`

It’s very likely that you typo’d the address during discourse-setup, which would explain why your server can’t resolve it. You can re-run discourse-setup or edit the app.yml to correct it.

---

<div class="post-metadata">

### Author: ![MST2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mst2/32/139354_2.png) [@MST2](https://meta.discourse.org/u/MST2)
#### Post date: [April 25, 2019, 10:43pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/9 "2019-04-25T22:43:58Z")

</div>

> [@Stephen](#):
>
> `cat /var/discourse/containers/app.yml | grep "smtp.sparkpostmail.com"`

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/5/0591c82b30e2ba49d2bab4abab47e313f5250602.jpeg)

> [@Stephen](#):
>
> ping [smtp.sparkpostmail.com](http://smtp.sparkpostmail.com)

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/b/cb4ec87c5096b22e2b664d4efa451267e4ca58ee.jpeg)

Since there is no response from this:

> [@Stephen](#):
>
> `cat /var/discourse/containers/app.yml | grep "smtp.sparkpostmail.com"`

It means this:

> [@Stephen](#):
>
> It’s very likely that you typo’d the address during discourse-setup, which would explain why your server can’t resolve it. You can re-run discourse-setup or edit the app.yml to correct it.

Right?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 25, 2019, 10:46pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/10 "2019-04-25T22:46:07Z")

</div>

If you’re SSH’d into the Discourse server **and** Discourse is installed in that path then yes.

You can check what’s in that line by doing this:

`cat /var/discourse/containers/app.yml | grep "DISCOURSE_SMTP_ADDRESS:"`

It should return something, if it doesn’t then there’s something more fundamental that’s awry with your setup.

---

<div class="post-metadata">

### Author: ![MST2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mst2/32/139354_2.png) [@MST2](https://meta.discourse.org/u/MST2)
#### Post date: [April 25, 2019, 10:47pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/11 "2019-04-25T22:47:29Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/5/d/5d7e01d9b193c9dc69ef31e88a2d4f2bae11c430.jpeg)  
Here we go

---

<div class="post-metadata">

### Author: ![MST2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mst2/32/139354_2.png) [@MST2](https://meta.discourse.org/u/MST2)
#### Post date: [April 25, 2019, 10:48pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/12 "2019-04-25T22:48:37Z")

</div>

Oh I see it now, I wrote stmp even though it‘s smtp.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 25, 2019, 10:51pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/13 "2019-04-25T22:51:53Z")

</div>

Yep, so you transposed two characters, which led to an invalid mail server address. DNS resolution failed and gave you the original error.

You can:

1. re-run `discourse-setup` if you would prefer a prompt-driven process
2. edit it by hand using `vi` or `nano`
3. Use this to automatically substitute it for you:

> `sed -i 's/stmp.sparkpostmail.com/smtp.sparkpostmail.com/g' /var/discourse/containers/app.yml`

---

<div class="post-metadata">

### Author: ![MST2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mst2/32/139354_2.png) [@MST2](https://meta.discourse.org/u/MST2)
#### Post date: [April 25, 2019, 10:52pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/14 "2019-04-25T22:52:52Z")

</div>

Thanks for your help! I‘ll set it up the correct way now and I‘ll post in here again if it still does not work.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 25, 2019, 10:53pm UTC](https://meta.discourse.org/t/issues-troubleshooting-email/116016/15 "2019-04-25T22:53:48Z")

</div>

Good luck, it _should_ be plain sailing from here, let us know if not.
