# Trouble configuring Gmail SMTP with Watcher

**URL:** <https://discuss.elastic.co/t/trouble-configuring-gmail-smtp-with-watcher/168119>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [February 12, 2019, 10:05pm UTC](https://discuss.elastic.co/t/trouble-configuring-gmail-smtp-with-watcher/168119 "2019-02-12T22:05:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbril](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbril/32/67905_2.png) [@cbril](https://discuss.elastic.co/u/cbril)\
**Post date:** [February 12, 2019, 10:05pm UTC](https://discuss.elastic.co/t/trouble-configuring-gmail-smtp-with-watcher/168119/1 "2019-02-12T22:05:50Z")

</div>

I have been going in circles for the past few hours trying to set up alerting with Watcher in Elasticsearch. I would greatly appreciate if someone could help me troubleshoot. There is an error at the time that Elasticsearch tries to send an email through Google's SMTP server. I am seeing this in the watch execution output:  
`Couldn't connect to host, port: smtp.gmail.com, 587; timeout 120000`

Here is my Elasticsearch configuration:

> <https://gist.github.com/cbril/5955018d214aab353f76fa949cf3c9c7>

Here is my watch:

> <https://gist.github.com/cbril/6f6c088fea6008bf1b878f1d4702f5e5>

Here is the error output when the action fails:

> <https://gist.github.com/cbril/25590a25dd67ec698a8c71195be6ef3f>

Here is what I've already tried:

- Disabling firewall, this is not the issue
- Changing the Gmail account settings to allow less secure applications to access my account
- Enabling IMAP access on my Gmail account
- Reading Google's authentication requirements for SMTP [See (Gmail SMTP server) column](https://support.google.com/a/answer/176600?hl=en)
- Creating an App password for my Google account and using it in the smtp.password field

All of the things I've tried result in the same error (connection failure)  
Maybe I need to add additional settings in elasticsearch.yml for SSL?

---

<div class="post-metadata">

**Author:** ![brolly759](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@brolly759](https://discuss.elastic.co/u/brolly759)\
**Post date:** [February 12, 2019, 10:44pm UTC](https://discuss.elastic.co/t/trouble-configuring-gmail-smtp-with-watcher/168119/2 "2019-02-12T22:44:36Z")

</div>

I had something similar but it seems we cannot use outside SMTP server's now.

[https://www.elastic.co/guide/en/cloud/current/ec-watcher.html#ec-watcher-whitelist](https://www.elastic.co/guide/en/cloud/current/ec-watcher.html#ec-watcher-whitelist)

---

<div class="post-metadata">

**Author:** ![cbril](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbril/32/67905_2.png) [@cbril](https://discuss.elastic.co/u/cbril)\
**Post date:** [February 12, 2019, 10:53pm UTC](https://discuss.elastic.co/t/trouble-configuring-gmail-smtp-with-watcher/168119/3 "2019-02-12T22:53:08Z")

</div>

So, it looks like now there is only support to send email notifications through the Elasticsearch Service?

---

<div class="post-metadata">

**Author:** ![brolly759](https://avatars.discourse-cdn.com/v4/letter/b/6a8cbe/32.png) [@brolly759](https://discuss.elastic.co/u/brolly759)\
**Post date:** [February 12, 2019, 10:55pm UTC](https://discuss.elastic.co/t/trouble-configuring-gmail-smtp-with-watcher/168119/4 "2019-02-12T22:55:34Z")

</div>

Here is some of the info you are looking for on my post.

> [@Issue with automatic email reporting with Watcher](https://discuss.elastic.co/t/issue-with-automatic-email-reporting-with-watcher/168117/6):
>
> Please refer to the documentation about attaching reporting to watcher email action: [https://www.elastic.co/guide/en/x-pack/current/actions-email.html#email-action-reports](https://www.elastic.co/guide/en/x-pack/current/actions-email.html#email-action-reports)

---

<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 12, 2019, 10:55pm UTC](https://discuss.elastic.co/t/trouble-configuring-gmail-smtp-with-watcher/168119/5 "2019-03-12T22:55:41Z")

</div>

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