# Kan geen e-mails verzenden via lokale SMTP-server

**URL:** <https://meta.discourse.org/t/unable-to-send-emails-using-local-smtp-server/176643>\
**Category:** Self-hosting\
**Created:** [20 januari 2021 om 01:43 UTC](https://meta.discourse.org/t/unable-to-send-emails-using-local-smtp-server/176643 "2021-01-20T01:43:31Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![superman](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@superman](https://meta.discourse.org/u/superman)\
**Post date:** [20 januari 2021 om 15:32 UTC](https://meta.discourse.org/t/unable-to-send-emails-using-local-smtp-server/176643/14 "2021-01-20T15:32:31Z")

</div>

For setting up a local SMTP server on the same machine as the Discourse container, Discourse does not specify exactly what the correct values for the SMTP settings in app.yml should be. This leads to a great deal of confusion and errors.

In the app.yml settings, Discourse does not clearly specify what the DISCOURSE\_SMTP\_ADDRESS is supposed to be.

In reality it is [subdomain.domain.com](http://subdomain.domain.com), and not [mail.subdomain.domain.com](http://mail.subdomain.domain.com)

```
Correct values:
DISCOURSE_SMTP_ADDRESS: forum.domain.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: postmaster@forum.domain.com
DISCOURSE_SMTP_PASSWORD: "password"
DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)

```

Discourse does not clearly specify what the “server certificate” is in this error statement that is present after sending the initial registration email fails. The error message is located in:  
/discourse/shared/standalone/log/rails/production.log  
“Job exception: hostname “[mail.forum.domain.com](http://mail.forum.domain.com)” does not match the server certificate”.

However, in reality, the “server certificate” is simply the server’s ssl certificate.  
Also, in the error message, Discourse incorrectly mentions “hostname”, when instead what is being referred to in reality is actually the DISCOURSE\_SMTP\_ADDRESS.

There was struggle because of Discourse’s ambiguity.

The solution was simply to set the server’s ssl certificate to the correct ssl certificate.

When the problem was posted to the Discourse forum, there were a lot of misleading and unclear answers.

Discourse should fix these problems.

---

_[View the full topic](https://meta.discourse.org/t/unable-to-send-emails-using-local-smtp-server/176643)._
