# Watcher: multiple email accounts

**URL:** <https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [May 7, 2018, 12:47pm UTC](https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835 "2018-05-07T12:47:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jetnet](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jetnet](https://discuss.elastic.co/u/jetnet)\
**Post date:** [May 7, 2018, 12:47pm UTC](https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835/1 "2018-05-07T12:47:15Z")

</div>

Hi ES experts,

I'm trying to configure several Email accounts in `elasticsearch.yml`:

```auto
xpack.notification.email.account:
  acc1:
    profile: standard
    email_defaults:
      from: mail1@dom1.net
    smtp:
      auth: true
      starttls.enable: true
      host: smpt.dom1.net
      port: 587
      user: user1@dom1.net
      password: ******
  acc2:
    profile: gmail
    email_defaults:
      from: mail2@gmail.com
    smtp:
      auth: true
      starttls.enable: true
      host: smtp.gmail.com
      port: 587
      user: mail2
      password: *****

```

Which parameter do I need to use to specify, which email account should be taken? Is it the parameter `account` like this (the parameter `profile` gets added automatically for some reason):

```auto
  "actions": {
    "send_email": {
      "email": {
        "account": "acc1",
        "profile": "standard",
        "priority": "highest",
        "to": [
          "rec@dom1.net"
        ],
        "subject": "Watcher - Alert",
        "body": {
          "text": "{{ctx.payload}}"
        }
      }
    }
  }

```

Unfortunately it is not clear from the [documentation](https://www.elastic.co/guide/en/x-pack/current/actions-email.html#configuring-email-actions)

The problem is - no email gets sent, no errors in the logs...

Thanks a lot!

---

<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:** [May 7, 2018, 1:03pm UTC](https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835/2 "2018-05-07T13:03:22Z")

</div>

Hey,

can you share the output of the execute watch API when running the watch?

Also, did you put the account configuration into all of your nodes?

Apart from that the configuration looks ok as well as how to specify the account in the watch itself.

--Alex

---

<div class="post-metadata">

**Author:** ![jetnet](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jetnet](https://discuss.elastic.co/u/jetnet)\
**Post date:** [May 7, 2018, 1:16pm UTC](https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835/3 "2018-05-07T13:16:56Z")

</div>

hi Alex,

thanks for the prompt reply! I'm really sorry, the emails were sent successfully, but they landed into the spam folder, and I did not see them, that's why I thought the config was wrong 🙂  
Anyhow, it would be good to mention the parameter `account` on the documentation...

---

<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:** [May 7, 2018, 2:08pm UTC](https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835/4 "2018-05-07T14:08:07Z")

</div>

It is mentioned [here](https://www.elastic.co/guide/en/x-pack/6.2/actions-email.html#email-action-attributes) - which documentation are you referring to, so we can add it?

---

<div class="post-metadata">

**Author:** ![jetnet](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jetnet](https://discuss.elastic.co/u/jetnet)\
**Post date:** [May 7, 2018, 2:30pm UTC](https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835/5 "2018-05-07T14:30:27Z")

</div>

I apologize, I must have overlooked it ☹  
or, you just added it? 🙂  
Thank you again!

---

<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:** [May 8, 2018, 7:57am UTC](https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835/6 "2018-05-08T07:57:23Z")

</div>

I promise I didnt add it, that would be mean 🙂

glad you found it. As always, if you are missing anything in the docs, happy to get PRs or open issues

---

<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:** [June 5, 2018, 7:57am UTC](https://discuss.elastic.co/t/watcher-multiple-email-accounts/130835/7 "2018-06-05T07:57:28Z")

</div>

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