# Watcher Could not connect to SMTP host

**URL:** https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [February 21, 2018, 7:12am UTC](https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775 "2018-02-21T07:12:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ekaterina](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@Ekaterina](https://discuss.elastic.co/u/Ekaterina)
#### Post date: [February 21, 2018, 7:12am UTC](https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775/1 "2018-02-21T07:12:05Z")

</div>

Hi All,

I have recently got free elastic cloud trial. I am trying to create simple watcher that would send an emails, but it is failing on email sending stage  
I have whitelisted needed email addresses, but error seems to be not related to the addresses but to some conf problem

"actions": [  
{  
"id": "email\_administrator",  
"type": "email",  
"status": "failure",  
"error": {  
"root\_cause": [  
{  
"type": "messaging\_exception",  
"reason": "failed to send email with subject [Encountered logins] via account [work]"  
}  
],  
"type": "messaging\_exception",  
"reason": "failed to send email with subject [Encountered logins] via account [work]",  
"caused\_by": {  
"type": "messaging\_exception",  
"reason": "Could not connect to SMTP host: dockerhost, port: 10025, response: -1"  
}  
}  
}  
]  
I can not find any solution to my problem in the forum  
Thank you!

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 21, 2018, 8:10am UTC](https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775/2 "2018-02-21T08:10:10Z")

</div>

have you configured your own email account? You should not need to configure anything after the whitelisting is done. Just remove any account configuration and restart the cluster.

--Alex

---

<div class="post-metadata">

### Author: ![Ekaterina](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@Ekaterina](https://discuss.elastic.co/u/Ekaterina)
#### Post date: [February 21, 2018, 8:53am UTC](https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775/3 "2018-02-21T08:53:56Z")

</div>

I am on the cloud. It looks like it uses its own SMTP server. What do you mean by my own email account? What configuration should be made there? I do not have any email configuration except my normal email address here: [https://cloud.elastic.co/#/account/email-settings/](https://cloud.elastic.co/#/account/email-settings/)

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 22, 2018, 8:29am UTC](https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775/4 "2018-02-22T08:29:15Z")

</div>

can you try not setting any `account` in your watch when sending an email?

---

<div class="post-metadata">

### Author: ![Ekaterina](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@Ekaterina](https://discuss.elastic.co/u/Ekaterina)
#### Post date: [February 22, 2018, 10:12am UTC](https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775/5 "2018-02-22T10:12:05Z")

</div>

Thanks Alexander,

I have next watcher, can you please show what account should be removed or changed

`PUT \_xpack/watcher/watch/test  
{  
"input": {  
"search": {  
"request": {  
"indices": [  
"smarp"  
],  
"body": {  
"query": {  
"match\_all": {

```
        }
      }
    }
  }
}

```

},  
"condition": {  
"script": "for (def item : ctx.payload.hits.hits) {if (item.status == 'success') {return true;}}"

},  
"trigger": {  
"schedule": {  
"interval": "30s"  
}  
},  
"actions": {

```
"email_administrator": {
  "throttle_period": "15m",
  "email": {
    "to": "ekaterina.tsapaeva@smarp com",
    "subject": "Encountered {{ctx.payload.shards.total}} logins",
    "body": "",
    "attachments": {
      "attached_data": {
        "data": {
          "format": "json"
        }
      }
    },
    "priority": "high"
  }
}

```

}  
}`

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 23, 2018, 10:35am UTC](https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775/6 "2018-02-23T10:35:17Z")

</div>

Hey,

I just reread that you are on cloud. so you can file a ticket through the cloud customer support for further help, they should be able to get you going!

--Alex

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 23, 2018, 10:35am UTC](https://discuss.elastic.co/t/watcher-could-not-connect-to-smtp-host/120775/7 "2018-03-23T10:35:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
