# Can't send email from x-pack to gmail

**URL:** <https://discuss.elastic.co/t/cant-send-email-from-x-pack-to-gmail/108257>\
**Category:** Elasticsearch\
**Created:** [November 18, 2017, 11:52pm UTC](https://discuss.elastic.co/t/cant-send-email-from-x-pack-to-gmail/108257 "2017-11-18T23:52:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tran\_canh\_khanh](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@tran\_canh\_khanh](https://discuss.elastic.co/u/tran_canh_khanh)\
**Post date:** [November 18, 2017, 11:52pm UTC](https://discuss.elastic.co/t/cant-send-email-from-x-pack-to-gmail/108257/1 "2017-11-18T23:52:02Z")

</div>

Hi guys.  
I'm using x-pack to alert but i can't send email from x-pack to gmail.When it send email it had error **"MessagingException[failed to send email with subject [Watcher Notification] via account [gmail\_account]]; nested: MessagingException[can't determine local email address]; "**  
Im using elasticsearch 5.6,  
This is my configurable elasticsearch.xml

> xpack.notification.email.account:  
> gmail\_account:  
> profile: gmail  
> smtp:  
> auth: true  
> starttls.enable: true  
> host: [smtp.gmail.com](http://smtp.gmail.com)  
> port: 587  
> [user:aaaaaaaa@gmail.com](mailto:user:aaaaaaaa@gmail.com)  
> password: bbbbbbbbbbb

This is configured action of watcher

> "actions" : {  
> "send\_email" : {  
> "email" : {  
> "to" : "[aaaaa@gmail.com](mailto:aaaaa@gmail.com)",  
> "subject" : "Watcher Notification",  
> "body" : "{{ctx.payload.hits.total}} error logs found"  
> }  
> }  
> }

Please help me.

---

<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:** [November 19, 2017, 8:30am UTC](https://discuss.elastic.co/t/cant-send-email-from-x-pack-to-gmail/108257/2 "2017-11-19T08:30:27Z")

</div>

Hey,

have you set a `from` address somewhere?

--Alex

---

<div class="post-metadata">

**Author:** ![tran\_canh\_khanh](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@tran\_canh\_khanh](https://discuss.elastic.co/u/tran_canh_khanh)\
**Post date:** [November 19, 2017, 9:45am UTC](https://discuss.elastic.co/t/cant-send-email-from-x-pack-to-gmail/108257/3 "2017-11-19T09:45:39Z")

</div>

why do you use "from" in "action".Please explain detail for me.  
i read document at [https://www.elastic.co/guide/en/x-pack/current/actions-email.html](https://www.elastic.co/guide/en/x-pack/current/actions-email.html)  
"from" don't require in "action"

---

<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:** [November 19, 2017, 9:59am UTC](https://discuss.elastic.co/t/cant-send-email-from-x-pack-to-gmail/108257/4 "2017-11-19T09:59:45Z")

</div>

that example assumes you are using from in your account setup, which you havent either.

---

<div class="post-metadata">

**Author:** ![tran\_canh\_khanh](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@tran\_canh\_khanh](https://discuss.elastic.co/u/tran_canh_khanh)\
**Post date:** [November 27, 2017, 7:02am UTC](https://discuss.elastic.co/t/cant-send-email-from-x-pack-to-gmail/108257/5 "2017-11-27T07:02:08Z")

</div>

OK , thanks for your help. I fixed it.

---

<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:** [December 25, 2017, 7:02am UTC](https://discuss.elastic.co/t/cant-send-email-from-x-pack-to-gmail/108257/6 "2017-12-25T07:02:11Z")

</div>

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