# Cannot send email

**URL:** <https://discuss.elastic.co/t/cannot-send-email/63548>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [October 20, 2016, 8:56pm UTC](https://discuss.elastic.co/t/cannot-send-email/63548 "2016-10-20T20:56:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryang97](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@ryang97](https://discuss.elastic.co/u/ryang97)\
**Post date:** [October 20, 2016, 8:56pm UTC](https://discuss.elastic.co/t/cannot-send-email/63548/1 "2016-10-20T20:56:32Z")

</div>

Hi,

I encountered this error

{  
"id": "email\_admin",  
"type": "email",  
"status": "failure",  
"reason": "MessagingException[failed to send email with subject [testing] via account [work]]; nested: MessagingException[Could not convert socket to TLS]; nested: SSLException[java.security.ProviderException: java.security.KeyException]; nested: ProviderException[java.security.KeyException]; nested: KeyException; "  
}

here is my configuration

curl -XPUT '[http://localhost:9200/\_watcher/watch/log\_error\_watch](http://localhost:9200/_watcher/watch/log_error_watch)' -d '{  
"trigger" : {  
"schedule" : { "interval" : "60s" }  
},  
"input" : {  
"http" : {  
"request" : {  
"host" : "localhost",  
"port" : 9200,  
"path" : "/filebeat-2016.10.16/\_search?pretty",  
"body" : "{"query" : { "match" : { "response" : "404"}}}"  
}  
}  
},  
"condition" : {  
"always" : {}  
},  
"actions" : {  
"email\_admin" : {  
"email": {  
"to": "xxx@gmail.com",  
"subject": "testing",  
"body": "testing"  
}  
}  
}  
}'

watcher.actions.email.service.account:  
work:  
profile: gmail  
smtp:  
auth: true  
starttls.enable: true  
host: [smtp.gmail.com](http://smtp.gmail.com)  
port: 587  
user: [xxx@gmail.com](mailto:xxx@gmail.com)  
password: xxx

does anyone know what is going wrong?

---

<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:** [October 21, 2016, 9:07am UTC](https://discuss.elastic.co/t/cannot-send-email/63548/3 "2016-10-21T09:07:11Z")

</div>

Hey,

on which system are you running? Which JDK are you using?

--Alex

---

<div class="post-metadata">

**Author:** ![ryang97](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@ryang97](https://discuss.elastic.co/u/ryang97)\
**Post date:** [October 21, 2016, 3:33pm UTC](https://discuss.elastic.co/t/cannot-send-email/63548/4 "2016-10-21T15:33:33Z")

</div>

thanks for your reply, after i changed the auth: true to auth: false, it works.

I am running Centos 6 and openjdk 8

---

<div class="post-metadata">

**Author:** ![ryang97](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@ryang97](https://discuss.elastic.co/u/ryang97)\
**Post date:** [October 24, 2016, 3:30pm UTC](https://discuss.elastic.co/t/cannot-send-email/63548/5 "2016-10-24T15:30:59Z")

</div>

Hi, Alex

I am also curious about is it possible to query 2 fields at the same time? If it is possible, how?

I tried something like

"input" : {  
"http" : {  
"request" : {  
"host" : "localhost",  
"port" : 9200,  
"path" : "'/filebeat-2016.10.20/\_search?pretty'",  
"body" : "{  
"query" : {  
"and" : [  
{  
"range": {  
"@timestamp" : {  
"from": "2016-10-20T23:58:00.000Z",  
"to": "2016-10-20T23:59:00.000Z"  
}  
}  
},  
{  
"match" : { "response" : "500"}  
}  
]  
}  
}"  
}  
}  
},

but failed

---

<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:** [October 24, 2016, 3:46pm UTC](https://discuss.elastic.co/t/cannot-send-email/63548/6 "2016-10-24T15:46:17Z")

</div>

Hey,

please open a new topic for a new question. You might want to take a look at the search input, then you dont have to quote that JSON.

--Alex

---

<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:42pm UTC](https://discuss.elastic.co/t/cannot-send-email/63548/7 "2017-07-06T13:42:22Z")

</div>


