# Email setup not working in elasticsearch.yml

**URL:** <https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [April 26, 2019, 9:21am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601 "2019-04-26T09:21:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MiddlewareTeam](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@MiddlewareTeam](https://discuss.elastic.co/u/MiddlewareTeam)\
**Post date:** [April 26, 2019, 9:21am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/1 "2019-04-26T09:21:37Z")

</div>

Below is the snippet of my elasticsearch.yml related to email setup for alert triggerring.

> #file  
> xpack.notification.email.account:  
> exchange\_account:  
> profile: outlook  
> smtp:  
> auth: true  
> starttls.enable: true  
> host: [hostname.domain.com](http://hostname.domain.com)  
> port: 25  
> user: account  
> password: password

but when I start elasticsearch it throws error like below (apology as I can not take actual data out so sharing screenshot)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/0/10770e29ada2df04071c4727eb8148cb5ccc4f08.png)

Can anyone please help and suggest.

---

<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:** [April 26, 2019, 9:40am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/2 "2019-04-26T09:40:05Z")

</div>

please properly format your message. as this is in the YAML file, the indentation is key for this one. first please use markdown for proper formatting, second, it might be useful to see the whole configuration uploaded somewhere.

---

<div class="post-metadata">

**Author:** ![MiddlewareTeam](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@MiddlewareTeam](https://discuss.elastic.co/u/MiddlewareTeam)\
**Post date:** [April 26, 2019, 9:58am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/3 "2019-04-26T09:58:57Z")

</div>

Hi Spincale,

Did the same but it is getting change post upload. Formatted again for more clearer view.

Also other part of ES is working truly fine. Issue is coming only when I am adding this stanza.

---

<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:** [April 26, 2019, 7:45pm UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/4 "2019-04-26T19:45:44Z")

</div>

sorry, but this is still not helping. First it is not properly formatted - you can use markdown here, also for code formatting.

Also I asked for the complete configuration file, as this would help tremendously.

---

<div class="post-metadata">

**Author:** ![MiddlewareTeam](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@MiddlewareTeam](https://discuss.elastic.co/u/MiddlewareTeam)\
**Post date:** [April 29, 2019, 6:46am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/5 "2019-04-29T06:46:10Z")

</div>

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

Hi Spinscale,

Made some changes also provided screenshot of the yml file for your reference. Let me know if you can help with this! or let usknow if you need more details.

---

<div class="post-metadata">

**Author:** ![MiddlewareTeam](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@MiddlewareTeam](https://discuss.elastic.co/u/MiddlewareTeam)\
**Post date:** [April 30, 2019, 11:06am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/6 "2019-04-30T11:06:29Z")

</div>

I got success in removing the yml error now. But facing issue while sending showing below error in the logs. Can someone please help!

Also to be precise I am able to send mail from server using telnet command but not through Kibana alert mechanism. Any input is much appreciated.

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

---

<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:** [April 30, 2019, 12:12pm UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/7 "2019-04-30T12:12:42Z")

</div>

I think the `smtp` part is indented one way too much, see the examples at [https://www.elastic.co/guide/en/elastic-stack-overview/7.0/actions-email.html](https://www.elastic.co/guide/en/elastic-stack-overview/7.0/actions-email.html)

---

<div class="post-metadata">

**Author:** ![MiddlewareTeam](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@MiddlewareTeam](https://discuss.elastic.co/u/MiddlewareTeam)\
**Post date:** [May 1, 2019, 11:44am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/8 "2019-05-01T11:44:14Z")

</div>

Hi Alex,

Thanks for the link, I have already gone through this but I have one doubt over the same.

What is outlook\_account\_profile here do I need to create those anywhere on the exchange server or locally on the VDI? I don't have exchange server in the zone where my ES is installed. My configuration is not going ahead of the profile itself.

Thanks in advance!

---

<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 6, 2019, 7:52am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/9 "2019-05-06T07:52:27Z")

</div>

It is pretty much impossible to help further without having access to the **exact** configuration file being used (not a screenshot, not a copy-paste somewhere), as long as there is such a start up error. If that error is gone, we can try executing a watch and see what the error message is in there.

---

<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 3, 2019, 7:52am UTC](https://discuss.elastic.co/t/email-setup-not-working-in-elasticsearch-yml/178601/10 "2019-06-03T07:52:28Z")

</div>

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