# Discourse connects to the SMTP server but fails to send email through it

**URL:** <https://meta.discourse.org/t/discourse-connects-to-the-smtp-server-but-fails-to-send-email-through-it/174501>\
**Category:** Self-hosting\
**Created:** [December 29, 2020, 2:31pm UTC](https://meta.discourse.org/t/discourse-connects-to-the-smtp-server-but-fails-to-send-email-through-it/174501 "2020-12-29T14:31:36Z")\
**Posts on this page:** 1\
**Showing post:** 8

<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:** [January 17, 2021, 7:27pm UTC](https://meta.discourse.org/t/discourse-connects-to-the-smtp-server-but-fails-to-send-email-through-it/174501/8 "2021-01-17T19:27:27Z")

</div>

Exim4 was tested to verify it sends and receives emails.  
Discourse was rebuilt with discourse-setup, using all the correct credentials:

```plaintext
Hostname : forum domainname com
Email : user@test com
SMTP address : mail forum domainname com
SMTP port : 587
SMTP username : postmaster@forum domainname com
SMTP password : password

```

Then, discourse-doctor is run to test weather Discourse can send email from the local exim4 mail server.

Discourse-doctor says:  
“SMTP server connection successful.”  
“Sending mail failed.”

However, there are no errors in the exim4 log.

Why does sending mail fail?  
Is this a common problem?

Notice that the SMTP address is: mail forum domainname com,  
should it have “mail” at the beginning?

Discourse-doctor says that Discourse does connect to:  
mail forum domainname com,  
but Discourse does not send the email.

---

_[View the full topic](https://meta.discourse.org/t/discourse-connects-to-the-smtp-server-but-fails-to-send-email-through-it/174501)._
