# Issue with setting up email configuration with Watcher

**URL:** <https://discuss.elastic.co/t/issue-with-setting-up-email-configuration-with-watcher/2406>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 11, 2015, 5:19am UTC](https://discuss.elastic.co/t/issue-with-setting-up-email-configuration-with-watcher/2406 "2015-06-11T05:19:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanmay\_Deshpande](https://avatars.discourse-cdn.com/v4/letter/t/7ab992/32.png) [@Tanmay\_Deshpande](https://discuss.elastic.co/u/Tanmay_Deshpande)\
**Post date:** [June 11, 2015, 5:19am UTC](https://discuss.elastic.co/t/issue-with-setting-up-email-configuration-with-watcher/2406/1 "2015-06-11T05:19:56Z")

</div>

I am trying Watcher Beta 2 and trying to setup email account which can be used to send email notifications. For that I have selected gmail profile, and have added following things in elasticsearch.yml

watcher.actions.email.service.account:  
profile: gmail  
gmail:  
smtp:  
auth: true  
starttls.enable: true  
host: [smtp.gmail.com](http://smtp.gmail.com)  
port: 587  
user:   
password:   
But as soon as I do this and start my cluster again, I see one error and cluster does not get started.

Here is what I get in logs

E:\es\elasticsearch-1.5.2\elasticsearch-1.5.2\bin\>elasticsearch  
[2015-06-11 10:39:59,166][INFO][node] [Bes] version[1.5.2]  
, pid[4892], build[62ff986/2015-04-27T09:21:06Z]  
[2015-06-11 10:39:59,168][INFO][node] [Bes] initializing .  
..  
[2015-06-11 10:39:59,277][INFO][plugins] [Bes] loaded [watche  
r, license], sites [head]  
[2015-06-11 10:39:59,367][INFO][watcher.trigger.schedule] [Bes] using [ticker]  
schedule trigger engine  
[2015-06-11 10:40:05,205][INFO][node] [Bes] initialized  
[2015-06-11 10:40:05,325][INFO][node] [Bes] starting ...  
{1.5.2}: Startup Failed ...

- EmailSettingsException[missing required email account setting for account [pro  
file]. 'smtp.host' must be configured]  
Exception in thread "Thread-1" java.lang.NullPointerException  
at org.elasticsearch.cluster.action.index.MappingUpdatedAction.stop(Mapp  
ingUpdatedAction.java:108)  
at org.elasticsearch.node.internal.InternalNode.stop(InternalNode.java:2

1. 

```
at org.elasticsearch.node.internal.InternalNode.close(InternalNode.java:

```

2. at org.elasticsearch.bootstrap.Bootstrap$1.run(Bootstrap.java:75)

Can someone help me with this ?

---

<div class="post-metadata">

**Author:** ![uboness](https://avatars.discourse-cdn.com/v4/letter/u/96bed5/32.png) [@uboness](https://discuss.elastic.co/u/uboness)\
**Post date:** [June 11, 2015, 11:07am UTC](https://discuss.elastic.co/t/issue-with-setting-up-email-configuration-with-watcher/2406/2 "2015-06-11T11:07:21Z")

</div>

Hi Tanmay,

The `profile` needs to go under the account:

```
watcher.actions.email.service.account:
    gmail:
        profile: gmail
        smtp:
            auth: true
            starttls.enable: true
            host: smtp.gmail.com
            port: 587
            user: xxxxxx
            password: yyyyyy
```

---

<div class="post-metadata">

**Author:** ![Tanmay\_Deshpande](https://avatars.discourse-cdn.com/v4/letter/t/7ab992/32.png) [@Tanmay\_Deshpande](https://discuss.elastic.co/u/Tanmay_Deshpande)\
**Post date:** [June 11, 2015, 11:44am UTC](https://discuss.elastic.co/t/issue-with-setting-up-email-configuration-with-watcher/2406/3 "2015-06-11T11:44:14Z")

</div>

Thanks. The error is gone.

---

<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:** [July 6, 2017, 1:49pm UTC](https://discuss.elastic.co/t/issue-with-setting-up-email-configuration-with-watcher/2406/4 "2017-07-06T13:49:35Z")

</div>


