# I dont know whats wrong with the SMTP service

**URL:** https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454
**Category:** Self-hosting
**Tags:** email
**Created:** [January 11, 2023, 6:51pm UTC](https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454 "2023-01-11T18:51:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![youyou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/youyou/32/287713_2.png) [@youyou](https://meta.discourse.org/u/youyou)
#### Post date: [January 11, 2023, 6:51pm UTC](https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454/1 "2023-01-11T18:51:34Z")

</div>

I use the service of [mailgun.com](http://mailgun.com) to send mail, but the SMTP I set up according to the tutorial doesn’t work.I can’t even finish registering as an administrator

the log in shared/standalone/log/rails/production.log

```plaintext
Started GET "/finish-installation/register" for 54.151.175.32 at 2023-01-11 18:37:43 +0000
Processing by FinishInstallationController#register as HTML
  Rendered finish_installation/register.html.erb within layouts/finish_installation (Duration: 8.2ms | Allocations: 750)
  Rendered layout layouts/finish_installation.html.erb (Duration: 33.4ms | Allocations: 3008)
Completed 200 OK in 54ms (Views: 36.7ms | ActiveRecord: 0.0ms | Allocations: 4064)
Started POST "/finish-installation/register" for 54.151.175.32 at 2023-01-11 18:37:45 +0000
Processing by FinishInstallationController#register as HTML
  Parameters: {"authenticity_token"=>"rxWiZY9rnT7TRGYXw *****************************iBAFuOoz7pQA", "email"=>"************************* @gmail.com", "username"=>"youyou", "password"=>"[FILTERED]", "commit"=>"Register"}
start
Redirected to https://bbs.doublekm.xyz/finish-installation/confirm-email
Completed 302 Found in 47ms (ActiveRecord: 0.0ms | Allocations: 2579)
  Rendered layouts/email_template.html.erb (Duration: 1.1ms | Allocations: 35)
Started GET "/finish-installation/confirm-email" for 54.151.175.32 at 2023-01-11 18:37:45 +0000
Processing by FinishInstallationController#confirm_email as HTML
  Rendered finish_installation/confirm_email.html.erb within layouts/finish_installation (Duration: 2.5ms | Allocations: 380)
  Rendered layout layouts/finish_installation.html.erb (Duration: 21.1ms | Allocations: 2643)
Completed 200 OK in 26ms (Views: 22.8ms | ActiveRecord: 0.0ms | Allocations: 3240)
Job exception: Net::SMTPUnknownError

fail

```

SMTP settings

```plaintext
  DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: postmaster@sandboxba2 ****************** d8f.mailgun.org
  DISCOURSE_SMTP_PASSWORD: "4223 ********************************************* 5f57"
  #DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
  DISCOURSE_SMTP_DOMAIN: sandboxba22 ************************ 8d8f.mailgun.org
  DISCOURSE_NOTIFICATION_EMAIL: no-reply@sandboxba22 *************** d8f.mailgun.org
  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
  LETSENCRYPT_ACCOUNT_EMAIL: me@example.com

```

```plaintext
[root@GreenCloud discourse]# telnet smtp.mailgun.org 587
Trying 34.83.33.178...
Connected to smtp.mailgun.org.
Escape character is '^]'.
220 Mailgun Influx ready
quit
221 See you later. Yours truly, Mailgun
Connection closed by foreign host.

```

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [January 11, 2023, 7:04pm UTC](https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454/2 "2023-01-11T19:04:48Z")

</div>

You need to check the security option because it isn’t very precise and you need to turn it off (without compromising your security).

> [@Setting up SMTP](https://meta.discourse.org/t/setting-up-smtp/33885/6):
>
> If you want to disable TLS, you need to uncomment this line, and set it to false: #DISCOURSE\_SMTP\_ENABLE\_START\_TLS: true # (optional, default true) However, there’s no relationship between POODLE and newer TLS protocol versions, nor is there any relationship between SMTP and POP3. Mailgun does support TLS on SMTP connections, they just don’t support it correctly.

---

<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: [January 11, 2023, 9:48pm UTC](https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454/3 "2023-01-11T21:48:33Z")

</div>

Why are you using a sandbox account for Mailgun? You should be using the postmaster account which corresponds to the domain for your community.

Did you have problems adding and authorizing the domain which corresponds do your community?

What email address is your community configured to send email from?

---

<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: [January 12, 2023, 9:17am UTC](https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454/4 "2023-01-12T09:17:01Z")

</div>

You need to not use sandbox mode, which I believe can send only to a single address. There is no reason not to get mailgun configured properly.

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

---

<div class="post-metadata">

### Author: ![youyou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/youyou/32/287713_2.png) [@youyou](https://meta.discourse.org/u/youyou)
#### Post date: [January 12, 2023, 9:24am UTC](https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454/5 "2023-01-12T09:24:07Z")

</div>

i use mailu to build a smtp service, i can send and receive the email

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/2/5/02592c93ab3ea2cb4d8b1eccd92355c3fab53b4a.png)

,but this time still wrong

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/8/8/888492dc17faeeb027227697f8243ac81f041815.png)

and also i cant login by foxmail

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/7/5/075cc92ed9276dc4e0754bbd69392e6106b6bcc1.png)

the smtp setting

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/d/7/1d72b8f141a9f5e3d08f4c8669c1794ddb552822.png)

the discourse setting

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/d/f/7df31b63ed65fdc9b57ba4acd98bc57a8ea96c9f.png)

---

<div class="post-metadata">

### Author: ![youyou](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/youyou/32/287713_2.png) [@youyou](https://meta.discourse.org/u/youyou)
#### Post date: [January 12, 2023, 9:33am UTC](https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454/6 "2023-01-12T09:33:37Z")

</div>

ohh,i solved by open the ssl

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/c/a/7cabf73bf473d11f25e390a1cb7dee5b14f725dc.png)  
does that means i should open ssl settings for discourse?

---

<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: [January 12, 2023, 7:10pm UTC](https://meta.discourse.org/t/i-dont-know-whats-wrong-with-the-smtp-service/251454/7 "2023-01-12T19:10:37Z")

</div>

So you gave up on mailgun and decided to use something else that no one has ever heard of?

It says that it won’t let you send from norepy@bbs.doublekm.xzy. Change the notification email to Makima@bbs.doublekm.xyz, and see if that works.
