# Watcher Email Configuration not able to send mail:

**URL:** <https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 29, 2020, 5:36pm UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850 "2020-08-29T17:36:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AKumar123](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@AKumar123](https://discuss.elastic.co/u/AKumar123)\
**Post date:** [August 29, 2020, 5:36pm UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850/1 "2020-08-29T17:36:20Z")

</div>

Continuing the discussion from [Watcher email configuration](https://discuss.elastic.co/t/watcher-email-configuration/208356/2):

1)I am facing this Issue while testing Mail through watcher:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/8/58dfacd33b82dd7ab5c8ad2f8921aa844bcc48cc.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/e/2eb04fd2fa0cffd74b6058f051d908e2d8277469.png)

2)This is yml configuration:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/2/52880b4c8c5220b5ad2e5db3fa4fd05a6f7764d8.png)  
3)Secure Password:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b75c63ca6be905c4b6646fb30fcb8d12ff3a98f.png)

For the Email Configuration i have done 2 and 3 steps.Is there any more thing required.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 30, 2020, 5:38am UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850/2 "2020-08-30T05:38:46Z")

</div>

Your step 2) elasticsearch.yml  
Is not formatted correctly. You need to indent correctly see the example use only spaces yml needs to be exact.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html#outlook](https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html#outlook)

---

<div class="post-metadata">

**Author:** ![AKumar123](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@AKumar123](https://discuss.elastic.co/u/AKumar123)\
**Post date:** [August 31, 2020, 10:21am UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850/3 "2020-08-31T10:21:30Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/9/d/9d8a46cf71557b4e85efac54cb91c1e4589fbf64.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/1/81015ec522fff44d1d06e1c6f409e4424daa4d80.png)

Still getting this error can you please help me to fix.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 31, 2020, 2:05pm UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850/4 "2020-08-31T14:05:35Z")

</div>

As you can see in the logs the credentials are not accepted.

As instructed in the docs you are required to put the `secure_password` in the keystore. You cannot put it in the yml.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html#gmail](https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html#gmail)

Since it looks like you are using elastic cloud see here for how to put that in keystore.

[https://www.elastic.co/guide/en/cloud/current/ec-configuring-keystore.html](https://www.elastic.co/guide/en/cloud/current/ec-configuring-keystore.html)

add

`xpack.notification.email.account.gmail_account.smtp.secure_password`

`password`

You may also need to follow the docs about Gmail authentication

If you get an authentication error that indicates that you need to continue the sign-in process from a web browser when Watcher attempts to send email, you need to configure Gmail to [Allow Less Secure Apps to access your account](https://support.google.com/accounts/answer/6010255?hl=en).

---

<div class="post-metadata">

**Author:** ![AKumar123](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@AKumar123](https://discuss.elastic.co/u/AKumar123)\
**Post date:** [August 31, 2020, 6:55pm UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850/5 "2020-08-31T18:55:10Z")

</div>

I have done this also then also not able to get success.

`xpack.notification.email.account.gmail_account.smtp.secure_password`

`password`

---

<div class="post-metadata">

**Author:** ![AKumar123](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@AKumar123](https://discuss.elastic.co/u/AKumar123)\
**Post date:** [September 1, 2020, 2:26pm UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850/6 "2020-09-01T14:26:56Z")

</div>

can you please help

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 1, 2020, 8:38pm UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850/7 "2020-09-01T20:38:39Z")

</div>

What is the error now?

Please do not provide Screen shot of error log, paste in the text and format with `</>`

Have you looked at the URL that google provided in the error log.

[https://support.google.com/mail?p=BadCredentials](https://support.google.com/mail?p=BadCredentials)

Elastic Is Trying to connect but Google is saying Bad Credentials

You need to dig around a bit....

---

<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:** [September 29, 2020, 8:38pm UTC](https://discuss.elastic.co/t/watcher-email-configuration-not-able-to-send-mail/246850/8 "2020-09-29T20:38:47Z")

</div>

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