# Can't Send Emails

**URL:** https://meta.discourse.org/t/cant-send-emails/224414
**Category:** Self-hosting
**Created:** [April 15, 2022, 12:42pm UTC](https://meta.discourse.org/t/cant-send-emails/224414 "2022-04-15T12:42:24Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![ethhaqn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethhaqn/32/257051_2.png) [@ethhaqn](https://meta.discourse.org/u/ethhaqn)
#### Post date: [April 15, 2022, 12:42pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/1 "2022-04-15T12:42:25Z")

</div>

I’m not receiving emails when I create an account and I was wondering if I did anything wrong.. what’s the difference between an SMTP address and an SMTP domain?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 15, 2022, 12:47pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/2 "2022-04-15T12:47:17Z")

</div>

SMTP address: [user@example.com](mailto:user@example.com)  
SMTP domain: [example.com](http://example.com)

---

<div class="post-metadata">

### Author: ![ethhaqn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethhaqn/32/257051_2.png) [@ethhaqn](https://meta.discourse.org/u/ethhaqn)
#### Post date: [April 15, 2022, 1:42pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/3 "2022-04-15T13:42:43Z")

</div>

Do you think you could help me? I’ve used an SMTP tool online and it all works fine, but Discourse doesn’t seem to be sending emails when I sign up..

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [April 15, 2022, 2:22pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/4 "2022-04-15T14:22:28Z")

</div>

Hello and welcome @ethhaqn 🙂

Have you checked out the troubleshooting guide?

> [@Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326):
>
> You just installed Discourse via [the install guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL.md), but email doesn’t seem to work. Unfortunately this means you can’t log in as an admin to finalize the install. cry Let’s troubleshootize! Try the doctor woman_health_workerIf you run ./discourse-doctor it will check several ways that your mail configuration might be broken, and offer advice. Try that first. Did you enter email settings correctly? The simplest way is to run ./discourse-setup again. Did you enter everything correctly? B…

---

<div class="post-metadata">

### Author: ![ethhaqn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethhaqn/32/257051_2.png) [@ethhaqn](https://meta.discourse.org/u/ethhaqn)
#### Post date: [April 15, 2022, 2:27pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/5 "2022-04-15T14:27:22Z")

</div>

I used `telnet mail.theapi.tech 25` and it returned `220 myhelper.tech ESMTP Postfix`, an old domain that I used for testing this system. Do you think it’s making an impact on email sending? If so, where can I change the domain? Again, it’s an old domain but I’m not sure where I could’ve inputted this domain for it to be returned when I run `telnet mail.theapi.tech 25`.

It may also be worth nothing that `./discourse-doctor` told me that there was an uncommon error and couldn’t seem to resolve my issue.

Also, I didn’t use `./discourse-setup` to setup Discourse as port 80 was taken. Instead, I manually edited `containers/app.yml` and ran `./launcher rebuild app`.

---

<div class="post-metadata">

### Author: ![ethhaqn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethhaqn/32/257051_2.png) [@ethhaqn](https://meta.discourse.org/u/ethhaqn)
#### Post date: [April 15, 2022, 2:40pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/6 "2022-04-15T14:40:46Z")

</div>

I used `tail shared/standalone/log/rails/production.log` and the logs say:

```plaintext
Processing by FinishInstallationController#confirm_email as HTML
  Rendered finish_installation/confirm_email.html.erb within layouts/finish_installation (Duration: 0.7ms | Allocations: 255)
  Rendered layout layouts/finish_installation.html.erb (Duration: 6.7ms | Allocations: 2103)
Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.0ms | Allocations: 2735)
start
  Rendered layouts/email_template.html.erb (Duration: 0.1ms | Allocations: 34)
Delivered mail 0e5b023a-90f9-4c23-ae2b-488b4d70d907@theapi.tech (39.6ms)
Job exception: hostname "mail.theapi.tech" does not match the server certificate

fail

```

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 15, 2022, 3:43pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/7 "2022-04-15T15:43:45Z")

</div>

`openssl s_client -connect mail.theapi.tech:25 -starttls smtp -showcerts`

```plaintext
Verification error: self signed certificate

```

So you need to set `DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none` in your `app.yml`

---

<div class="post-metadata">

### Author: ![ethhaqn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethhaqn/32/257051_2.png) [@ethhaqn](https://meta.discourse.org/u/ethhaqn)
#### Post date: [April 15, 2022, 3:45pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/8 "2022-04-15T15:45:56Z")

</div>

Won’t that make it so that you don’t need to verify your email?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 15, 2022, 3:47pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/9 "2022-04-15T15:47:07Z")

</div>

No. It will make Discourse skip the verification that is failing right now.

---

<div class="post-metadata">

### Author: ![ethhaqn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethhaqn/32/257051_2.png) [@ethhaqn](https://meta.discourse.org/u/ethhaqn)
#### Post date: [April 15, 2022, 4:02pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/10 "2022-04-15T16:02:36Z")

</div>

Ah, there we go. How would I get an SSL certificate? This is in my `app.yml` btw:

![image](https://global.discourse-cdn.com/meta/original/4X/2/6/0/260a6bf43d8676f3809f7124b262d74600e01155.png)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 15, 2022, 4:14pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/11 "2022-04-15T16:14:04Z")

</div>

> [@ethhaqn](#):
>
> How would I get an SSL certificate?

I think the part where you set up your own mail server is outside of the scope of this forum.

---

<div class="post-metadata">

### Author: ![ethhaqn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethhaqn/32/257051_2.png) [@ethhaqn](https://meta.discourse.org/u/ethhaqn)
#### Post date: [April 15, 2022, 4:15pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/12 "2022-04-15T16:15:15Z")

</div>

Nono, not on my mail server. Like, on my actual Discourse site.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 15, 2022, 4:29pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/13 "2022-04-15T16:29:49Z")

</div>

Please follow [Run other websites on the same machine as Discourse](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247) and if that fails, open a new topic.

---

<div class="post-metadata">

### Author: ![sukria](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sukria/32/120405_2.png) [@sukria](https://meta.discourse.org/u/sukria)
#### Post date: [May 12, 2022, 11:46am UTC](https://meta.discourse.org/t/cant-send-emails/224414/14 "2022-05-12T11:46:27Z")

</div>

> [@RGJ](#):
>
> DISCOURSE\_SMTP\_OPENSSL\_VERIFY\_MODE:

Hi, I’ve upgraded my local instance of Discourse to 2.9.0.beta4 and even after adding DISCOURSE\_SMTP\_OPENSSL\_VERIFY\_MODE: “none” in my containers/app.yml file (and rebuilding the app), I still keep getting such errors:

```plaintext
  Rendered layouts/email_template.html.erb (Duration: 0.2ms | Allocations: 34)
Delivered mail 31c5b9eb-1077-4155-b040-314c4a8566cb@taverne.colorfulminis.com (11.3ms)
Job exception: SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate)

```

This obviously makes my Discourse instance unable to send emails anymore.  
Is there any known issue about this?

FYI: I’m running a preprod instance with **2.8.0.beta9** and exactly the same config, and emails get sent like a charm.

Thanks for your help.

---

<div class="post-metadata">

### Author: ![Kyominii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kyominii/32/260090_2.png) [@Kyominii](https://meta.discourse.org/u/Kyominii)
#### Post date: [May 12, 2022, 3:14pm UTC](https://meta.discourse.org/t/cant-send-emails/224414/15 "2022-05-12T15:14:28Z")

</div>

Hi Alexis,

I have the exact same problem on a VM (Ubuntu 22.04 with docker-based 2.9.0.beta4 Discourse instance). Even with `DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none` in container/app.yml (and $DISCOURSE\_SMTP\_OPENSSL\_VERIFY\_MODE in docker environment set to none), `certificate verify failed (self signed certificate)` continues to be raised

Edit: fyi, stable version (2.8.3) works as expected

---

<div class="post-metadata">

### Author: ![sukria](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sukria/32/120405_2.png) [@sukria](https://meta.discourse.org/u/sukria)
#### Post date: [May 18, 2022, 6:09am UTC](https://meta.discourse.org/t/cant-send-emails/224414/16 "2022-05-18T06:09:24Z")

</div>

For the record: enabling `DISCOURSE_SMTP_ENABLE_START_TLS: true` fixed the issue on my side.

---

<div class="post-metadata">

### Author: ![PCPal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pcpal/32/455064_2.png) [@PCPal](https://meta.discourse.org/u/PCPal)
#### Post date: [February 10, 2025, 5:31am UTC](https://meta.discourse.org/t/cant-send-emails/224414/17 "2025-02-10T05:31:03Z")

</div>

For anyone unsuccesfully searching for answers - and coming to this topic:  
I just had the pleasure of figuring out my VPS hosting provider, requires me to enable the outgoing mailports first, on a freshly installed box. I knew this, but only remembered after a nights sleep 😉  
Happy Hosting! 😃
