Unable to send alert with watcher email configuration

Hi,
I am getting following exception when trying to send a gmail message as alert:

.]).
[2016-10-05 15:10:06,845][ERROR][watcher.actions.email ] [Aries] failed to execute action [event_critical_watch/email_admin]
javax.mail.MessagingException: failed to send email with subject [event_critical_watch executed] via account [gmail];
** nested exception is:**
** com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout 120000;**
** nested exception is:**
** java.net.ConnectException: Connection refused: connect**
** at org.elasticsearch.watcher.actions.email.service.InternalEmailService.send(InternalEmailService.java:85)**
** at org.elasticsearch.watcher.actions.email.service.InternalEmailService.send(InternalEmailService.java:77)**
** at org.elasticsearch.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:84)**
** at org.elasticsearch.watcher.actions.ActionWrapper.execute(ActionWrapper.java:106)**
** at org.elasticsearch.watcher.execution.ExecutionService.executeInner(ExecutionService.java:388)**
** at org.elasticsearch.watcher.execution.ExecutionService.execute(ExecutionService.java:273)**
** at org.elasticsearch.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:438)**
** at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)**
** at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)**
** at java.lang.Thread.run(Thread.java:745)**
Caused by: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: smtp.gmail.com, 587; timeout 120000;
** nested exception is:**
** java.net.ConnectException: Connection refused: connect**
** at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2054)**
** at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697)**
** at javax.mail.Service.connect(Service.java:364)**
** at org.elasticsearch.watcher.actions.email.service.Account.send(Account.java:124)**
** at org.elasticsearch.watcher.actions.email.service.InternalEmailService.send(InternalEmailService.java:83)**
** ... 9 more**
Caused by: java.net.ConnectException: Connection refused: connect
** at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)**
** at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)**
** at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)**
** at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)**
** at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)**
** at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)**
** at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)**
** at java.net.Socket.connect(Socket.java:579)**
** at com.sun.mail.util.WriteTimeoutSocket.connect(WriteTimeoutSocket.java:112)**
** at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:327)**
** at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:236)**
** at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2020)**
** ... 13 more**
[2016-10-05 15:10:06,990][INFO ][cluster.metadata ] [Aries] [.watch_history-2016.10.05] creating index, cause [auto(index api)], templates [watch_history], shards [1]/
[1], mappings [watch_record]
[2016-10-05 15:10:07,167][INFO ][cluster.routing.allocation] [Aries] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[.watch_history-2016.10.05]
[0]] ...]).
[2016-10-05 15:10:07,226][INFO ][cluster.metadata ] [Aries] [.watch_history-2016.10.05] update_mapping [watch_record]

I have added following lines in elasticsearch.yml file .

watcher.actions.email.service.account:
gmail:
profile: gmail
smtp:
auth: true
starttls.enable: true
host: smtp.gmail.com
port: 587
user: @gmail.com
password: a
***

Please help me to solve this.

Hey,

I already answered in a previous thread, or to be more exact, right here. Please be kind and either provide more specific information or dont open new threads without any new information.

--Alex