# Setting up SMTP

**URL:** <https://meta.discourse.org/t/setting-up-smtp/33885>\
**Category:** Product Support\
**Created:** [29.Сентябрь.2015 20:51:35 UTC](https://meta.discourse.org/t/setting-up-smtp/33885 "2015-09-29T20:51:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Mechanatrix](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@Mechanatrix](https://meta.discourse.org/u/Mechanatrix)\
**Post date:** [29.Сентябрь.2015 20:51:35 UTC](https://meta.discourse.org/t/setting-up-smtp/33885/1 "2015-09-29T20:51:35Z")

</div>

Hello people of discourse 😃

I’ve been trying for a while to get my SMTP routing working, and now I’m getting an interesting issue when I check mailgun send logs. It finally goes through, but it tries to send to what appears to be a redundant email. This is the send log.

```
{
  "severity": "permanent",
  "tags": [],
  "delivery-status": {
    "retry-seconds": 14400,
    "message": "Unable to connect to MX servers: [example.com]",
    "code": 499,
    "description": "Unable to connect to MX servers: [example.com]",
    "session-seconds": 0
  },
  "envelope": {
    "targets": "bar@example.com",
    "transport": "smtp",
    "sender": "postmaster@mg.mechanatrix.com"
  },
  "recipient-domain": "example.com",
  "id": "it was a random string..but i figure security",
  "campaigns": [],
  "reason": "old",
  "user-variables": {},
  "flags": {
    "is-routed": null,
    "is-authenticated": true,
    "is-system-test": false,
    "is-test-mode": false
  },
  "log-level": "error",
  "timestamp": 1443525153.274898,
  "message": {
    "headers": {
      "to": "myuser@gmail.com, bar@example.com",
      "message-id": "20150928231513.16585.98440@mg.mechanatrix.com",
      "from": "Excited User <mailgun@discourse.mechanatrix.com>",
      "subject": "Hello"
    },
    "attachments": [],
    "recipients": [
      "myuser@gmail.com",
      "bar@example.com"
    ],
    "size": 549
  },
  "recipient": "bar@example.com",
  "event": "failed"
} 

```

\*I’ve replaced my email with [myuser@gmail.com](mailto:myuser@gmail.com)  
as you can see, its sending to [bar@example.com](mailto:bar@example.com)

This is whats in my app.yml

```
DISCOURSE_DEVELOPER_EMAILS: 'myuser@gmail.com'

## TODO: The domain name this Discourse instance will respond to
DISCOURSE_HOSTNAME: 'discourse.mechanatrix.com'

## TODO: The mailserver this Discourse instance will use
DISCOURSE_SMTP_ADDRESS: smtp.mailgun.com # (mandatory)
DISCOURSE_SMTP_PORT: 465 # (optional)
DISCOURSE_SMTP_USER_NAME: myuser@gmail.com # (optional)
DISCOURSE_SMTP_PASSWORD: myPassword # (optional, WARNING the c$
#DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)

```

Sorry everyone for the pretty newb question 😋

---

_[View the full topic](https://meta.discourse.org/t/setting-up-smtp/33885)._
