# Elasticsearch email alert question

**URL:** <https://discuss.elastic.co/t/elasticsearch-email-alert-question/157507>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [November 20, 2018, 9:36am UTC](https://discuss.elastic.co/t/elasticsearch-email-alert-question/157507 "2018-11-20T09:36:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_Z](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@S\_Z](https://discuss.elastic.co/u/S_Z)\
**Post date:** [November 20, 2018, 9:36am UTC](https://discuss.elastic.co/t/elasticsearch-email-alert-question/157507/1 "2018-11-20T09:36:40Z")

</div>

Hi  
When I tried the x-pack alarm function, I had a problem. Kibana told me Failed to send e-mail to [songzhao@union400.com](mailto:songzhao@union400.com). Below is the log I found in elasticsearch. I don't quite understand the problem. Where is it because I am a newbie

```
[2018-11-20T17:21:33,244][ERROR][o.e.x.w.a.e.ExecutableEmailAction] [O_lrvKb] failed to execute action [_inlined_/email_1]
    javax.mail.MessagingException: failed to send email with subject [Watch [ceshi] has exceeded the threshold] via account [exchange_account]
    	at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:147) ~[?:?]
    	at org.elasticsearch.xpack.watcher.notification.email.EmailService.send(EmailService.java:139) ~[?:?]
    	at org.elasticsearch.xpack.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:72) ~[?:?]
    	at org.elasticsearch.xpack.core.watcher.actions.ActionWrapper.execute(ActionWrapper.java:144) [x-pack-core-6.3.2.jar:6.3.2]
    	at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:475) [x-pack-watcher-6.3.2.jar:6.3.2]
    	at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:305) [x-pack-watcher-6.3.2.jar:6.3.2]
    	at org.elasticsearch.xpack.watcher.transport.actions.execute.TransportExecuteWatchAction$1.doRun(TransportExecuteWatchAction.java:154) [x-pack-watcher-6.3.2.jar:6.3.2]
    	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.3.2.jar:6.3.2]
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_181]
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_181]
    	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:626) [elasticsearch-6.3.2.jar:6.3.2]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181]
    	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
    Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.163.com, port: 465, response: -1
    	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2106) ~[?:?]
    	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:712) ~[?:?]
    	at javax.mail.Service.connect(Service.java:366) ~[?:?]
    	at org.elasticsearch.xpack.watcher.notification.email.Account.lambda$executeConnect$2(Account.java:153) ~[?:?]
    	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_181]
    	at org.elasticsearch.xpack.watcher.notification.email.Account.executeConnect(Account.java:152) ~[?:?]
    	at org.elasticsearch.xpack.watcher.notification.email.Account.send(Account.java:111) ~[?:?]
    	at org.elasticsearch.xpack.watcher.notification.email.EmailServ> Blockquoteice.send(EmailService.java:145) ~[?:?]
```

---

<div class="post-metadata">

**Author:** ![S\_Z](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@S\_Z](https://discuss.elastic.co/u/S_Z)\
**Post date:** [November 20, 2018, 10:01am UTC](https://discuss.elastic.co/t/elasticsearch-email-alert-question/157507/2 "2018-11-20T10:01:29Z")

</div>

I checked the mail server and it works fine. And I can send mail with mail.rc.  
I want to know if there are any modules that are not enabled.

English is not my native language, so the description is not very good, forgive 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 26, 2018, 4:26pm UTC](https://discuss.elastic.co/t/elasticsearch-email-alert-question/157507/3 "2018-11-26T16:26:12Z")

</div>

See this exception

> [@S\_Z](#):
>
> Caused by: javax.mail.MessagingException: Could not connect to SMTP host: [smtp.163.com](http://smtp.163.com), port: 465, response: -1

The elasticsearch node trying to send an email could not connect to this, maybe the full stack trace will reveal more information.

Also, if you test the remote mail server, please make sure you are testing from the elasticsearch system to check if you are maybe running into firewall configurations.

---

<div class="post-metadata">

**Author:** ![S\_Z](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@S\_Z](https://discuss.elastic.co/u/S_Z)\
**Post date:** [December 4, 2018, 1:28am UTC](https://discuss.elastic.co/t/elasticsearch-email-alert-question/157507/5 "2018-12-04T01:28:07Z")

</div>

Thanks for your reply, I will continue to try to solve this problem.:笑脸:

---

<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:** [January 1, 2019, 1:42am UTC](https://discuss.elastic.co/t/elasticsearch-email-alert-question/157507/6 "2019-01-01T01:42:02Z")

</div>

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