# "Houve um problema ao enviar o e-mail de teste."

**URL:** https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305
**Category:** Support
**Created:** [Janeiro 17, 2018, 7:08pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305 "2018-01-17T19:08:11Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 17, 2018, 7:08pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/1 "2018-01-17T19:08:11Z")

</div>

i’m just going through the Admin Quick Start Guide i’m at the step where i’m trying to send a test email, and getting this error:

**There was a problem sending the test email. Please double-check your mail settings, verify that your host is not blocking mail connections, and try again.**

i’m with Mailgun. i thought it was working properly? i’ve used the “password reset” link from Discourse a few times, and it’s worked. i just checked the Mailgun logs, and i don’t see any failed or bounced emails. What else could be the issue?

The error message tell me to “verify your host is not blocking mail connections.” If it was, would those password reset emails even be working?

Thanks!

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 17, 2018, 7:16pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/2 "2018-01-17T19:16:55Z")

</div>

Answering my own question… (i think…?)

In Mailgun, under Domains, i have the domain set as [mail.mysite.com](http://mail.mysite.com). i think it has to read [discourse.mysite.com](http://discourse.mysite.com)? Yes? No?

EDIT: Hmm. i’m not sure that’s it. When i look at Sent emails in my Discourse Admin panel, i see the four emails that were successfully sent (two forgot\_password emails, two signup emails).

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 17, 2018, 7:53pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/3 "2018-01-17T19:53:05Z")

</div>

Update: i ripped through mailgun and added the domain [rabbithole.lockquest.com](http://rabbithole.lockquest.com) instead of [mail.lockquest.com](http://mail.lockquest.com), then updated all the DNS records.

Where do i tell that to Discourse? i’ve checked Admin\>Settings\>Email, and Admin\>Emails. (And will that even fix the issue?)

---

<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: [Janeiro 17, 2018, 9:17pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/4 "2018-01-17T21:17:50Z")

</div>

> [@Untoldent](#):
>
> Update: i ripped through mailgun and added the domain [rabbithole.lockquest.com](http://rabbithole.lockquest.com) instead of [mail.lockquest.com](http://mail.lockquest.com), then updated all the DNS records.

That’s what you wanted to do!

That stuff isn’t in the web interface. Go back and run `discourse-setup` again and enter the new values.

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 17, 2018, 9:45pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/5 "2018-01-17T21:45:55Z")

</div>

```
**Hostname : rabbithole.lockquest.com**
 **Email : info@lockquest.com**
 **SMTP address : smtp.mailgun.org**
 **SMTP port : 587**
 **SMTP username : postmaster@rabbithole.lockquest.com**
**SMTP password : [redacted]**
 **Let's Encrypt : info@lockquest.com**

```

Does this all look correct?

i was more referring to a page which, maddeningly, i can no longer find, which said “if you want to send emails with Discourse, MAKE SURE this field says this,” and it had an image of the field with zero context, so i had no idea where to find it.

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 17, 2018, 9:56pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/6 "2018-01-17T21:56:58Z")

</div>

(test email still not working btw… not sure where to make adjustments?)

---

<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: [Janeiro 17, 2018, 10:02pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/7 "2018-01-17T22:02:36Z")

</div>

Looks OK.

Sometimes Digital Ocean blocks outgoing SMTP traffic. You can test with `telnet SMTPSERVER 587` if it connects, that might not be the problem, but you probably don’t have telnet installed, so If mail’s not working, then re-run `discourse-setup` and use port 2525 instead of 587. Or, if you prefer pain, create a ticket, wait a day, and hope that they’ll unblock it for you.

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 18, 2018, 2:45am UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/8 "2018-01-18T02:45:35Z")

</div>

Still no good. i submitted the ticket. 😕

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 18, 2018, 12:37pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/9 "2018-01-18T12:37:20Z")

</div>

i asked DigitalOcean to unblock ports 587 and 2525. This was their response:

_Thank you very much for getting in touch with us!_  
_I can confirm that SMTP over IPv4 is not currently being filtered on your account._  
_Please keep in mind, however, that SMTP over IPv6 is not currently available._  
_Please let us know if you have any other questions!_

Still can’t send a test email. What’s next?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Janeiro 18, 2018, 12:39pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/10 "2018-01-18T12:39:39Z")

</div>

If you are logged in as admin, did you check the `/logs` path in your web browser for errors related to the email sending?

---

<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: [Janeiro 18, 2018, 12:46pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/11 "2018-01-18T12:46:12Z")

</div>

I’ve had one install that couldn’t send to a self hosted mail server. It looked like the port was open (I could telnet there) but it never managed to send. I blamed it on their mail host.

I think the next thing is try it’s too delete that droplet and try a new one (or maybe try the new one first).

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 18, 2018, 1:12pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/12 "2018-01-18T13:12:56Z")

</div>

i tried telnet, and got this:

_root@lockquest:/var/discourse# telnet [smtp.mailgun.org](http://smtp.mailgun.org) 587_  
_Trying 52.35.57.220…_  
_Connected to [smtp.mailgun.org](http://smtp.mailgun.org)._

This is what the log said:

_ActionController::RoutingError (No route matches [GET] “/sftp-config.json”)_  
_/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action\_dispatch/middleware/debug\_exceptions.rb:63:in `call'_ _Started GET "/deployment-config.json" for 149.202.92.198 at 2018-01-18 12:26:42 +0000_ _ActionController::RoutingError (No route matches [GET] "/deployment-config.json")_ _/var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/debug_exceptions.rb:63:in `call’_  
_Started POST “/admin/email/test” for 99.248.139.107 at 2018-01-18 12:35:55 +0000_  
_Processing by Admin::EmailController#test as /_  
\_ Parameters: {“email\_address”=\>“[info@lockquest.com](mailto:info@lockquest.com)”}\_  
_Sent mail to [info@lockquest.com](mailto:info@lockquest.com) (1783.0ms)_  
_Completed 422 Unprocessable Entity in 2048ms (Views: 0.5ms | ActiveRecord: 3.5ms)_

Like i said, the attempt to send to [info@lockquest.com](mailto:info@lockquest.com) doesn’t appear on my Mailgun logs.

This is what my TXT records look like:

 ![](https://global.discourse-cdn.com/meta/original/3X/1/8/18fe72fa08edb0a0b6a71db25235b33dbb683c42.jpg)

i haven’t uncommented/recommented that noreply@ line in the .yml from this troubleshooting guide yet:

[https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326/2](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326/2)

The [rabbithole.lockquest.com](http://rabbithole.lockquest.com) status on Mailgun is green and active. Yes, they have my credit card number.

" Are you using an IP address as the mail domain?" i don’t know. Where do i check that?

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 18, 2018, 1:14pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/13 "2018-01-18T13:14:40Z")

</div>

Just looking at that image again, i see i’ve got k1.\_domainkey.rabbithole.lockquest.com, and krs.\_domainkey.mail.lockquest. Should it be k1 or krs? There must be two different pages/guides that each use one of these versions, because i wouldn’t know enough to invent one! 🙂

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 18, 2018, 7:29pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/14 "2018-01-18T19:29:55Z")

</div>

UPDATE: i deleted the [mail.lockquest.com](http://mail.lockquest.com) domain from Mailgun, leaving only the [rabbithole.lockquest.com](http://rabbithole.lockquest.com) domain there, and now the Forgot Password email from Discourse won’t send.

i DO see this in the logs:

_Job exception: 535 5.7.0 Mailgun is not loving your login or password_

Here’s the rest of the log in pastebin:

> <https://pastebin.com/PdL778Pz>

Anyone want to weigh in before i go eat this entire family-sized bag of Fritos by myself?

---

<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: [Janeiro 18, 2018, 7:52pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/15 "2018-01-18T19:52:26Z")

</div>

> [@Untoldent](#):
>
> Mailgun is not loving your login or password

My guess is that you don’t have the right password set in your `app.yml`. Re-run it with the values that mailgun gives you.

---

<div class="post-metadata">

### Author: ![Untoldent](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/untoldent/32/120297_2.png) [@Untoldent](https://meta.discourse.org/u/Untoldent)
#### Post date: [Janeiro 18, 2018, 8:24pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/16 "2018-01-18T20:24:08Z")

</div>

Of _course_ … if i add a new domain to Mailgun, it’s gonna have its own distinct password.

i re-ran setup with the new password, and - huzzah! The Forgot Password email came through, but more importantly, the test email did too! So, so happy. Fritos go back in the cupboard. Onto the next debilitating stumbling block. 😉

Thanks again, so much, for your help.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Janeiro 18, 2018, 8:34pm UTC](https://meta.discourse.org/t/there-was-a-problem-sending-the-test-email/78305/17 "2018-01-18T20:34:06Z")

</div>


