# Email does not work; Net::SMTPAuthenticationError

**URL:** <https://meta.discourse.org/t/email-does-not-work-net-smtpauthenticationerror/317828>\
**Category:** Self-hosting\
**Tags:** email\
**Created:** [July 23, 2024, 12:48pm UTC](https://meta.discourse.org/t/email-does-not-work-net-smtpauthenticationerror/317828 "2024-07-23T12:48:44Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [July 23, 2024, 8:29pm UTC](https://meta.discourse.org/t/email-does-not-work-net-smtpauthenticationerror/317828/5 "2024-07-23T20:29:59Z")

</div>

> [@wal](#):
>
> ```plaintext
> DISCOURSE_SMTP_USER_NAME: mail
> DISCOURSE_SMTP_PASSWORD: "12345678901234567890"
> DISCOURSE_SMTP_DOMAIN: mg.mydomain.com
> 
> ```

I’d wager `DISCOURSE_SMTP_USER_NAME` is incorrect - `mail` is probably not enough for mailgun to authenticate you. It should probably be `mail@mg.mydomain.com`

I’d guess you think `DISCOURSE_SMTP_DOMAIN` is the domain of the user? It’s not - it’s the EHLO domain. You almost definitely don’t need to set it.

---

_[View the full topic](https://meta.discourse.org/t/email-does-not-work-net-smtpauthenticationerror/317828)._
