# Problem while sending e-mail alerts

**URL:** <https://discuss.elastic.co/t/problem-while-sending-e-mail-alerts/99827>\
**Category:** Elasticsearch\
**Created:** [September 8, 2017, 9:36am UTC](https://discuss.elastic.co/t/problem-while-sending-e-mail-alerts/99827 "2017-09-08T09:36:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ademsimsek](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@ademsimsek](https://discuss.elastic.co/u/ademsimsek)\
**Post date:** [September 8, 2017, 9:36am UTC](https://discuss.elastic.co/t/problem-while-sending-e-mail-alerts/99827/1 "2017-09-08T09:36:58Z")

</div>

Hi all,

I have a problem while sending e-mail alerts.

my elasticsearch.yml file configuration:

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: \*\*\*\*\*\*@gmail.com  
password: \*\*\*\*\*\*

My watcher rule:

“actions”: {  
“send\_email”: {  
“email”: {  
“profile”: “standard”,  
“to”: [  
"ademsim@gmail.com"  
],  
“subject”: “Watcher Notification”,  
“body”: {  
“text”: “Test”  
}  
}  
}

And error:

Execution Failing

“reason”: "MessagingException[failed to send email with subject [Watcher Notification] via account [gmail\_account]]; nested: MessagingException[Exception reading response]; nested: SocketTimeoutException[Read timed out]; "

Could anyone help me for this case.

---

<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:** [September 11, 2017, 6:59am UTC](https://discuss.elastic.co/t/problem-while-sending-e-mail-alerts/99827/2 "2017-09-11T06:59:23Z")

</div>

This is not a watcher issue. The socket timeout exception indicates, that the node, which executes the watch is not able to connect to gmail. So very likely a firewall is dropping that connection, if that happens on every execution.

--Alex

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [September 11, 2017, 6:24pm UTC](https://discuss.elastic.co/t/problem-while-sending-e-mail-alerts/99827/3 "2017-09-11T18:24:52Z")

</div>

This is easy to test - from the machine you're running watcher on, try:

```auto
%> telnet smtp.gmail.com 587

```

You should get a response similar to:

```auto
Trying 74.125.124.108...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP k21sm5095469iti.28 - gsmtp

```

---

<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:** [October 9, 2017, 6:25pm UTC](https://discuss.elastic.co/t/problem-while-sending-e-mail-alerts/99827/4 "2017-10-09T18:25:36Z")

</div>

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