# Can't send alerts via email

**URL:** <https://forum.opensearch.org/t/cant-send-alerts-via-email/9285>\
**Category:** Alerting\
**Tags:** troubleshoot\
**Created:** [April 20, 2022, 2:39am UTC](https://forum.opensearch.org/t/cant-send-alerts-via-email/9285 "2022-04-20T02:39:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anton](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@anton](https://forum.opensearch.org/u/anton)\
**Post date:** [April 20, 2022, 2:39am UTC](https://forum.opensearch.org/t/cant-send-alerts-via-email/9285/1 "2022-04-20T02:39:29Z")

</div>

Hello.  
I’m trying to send an email alert, but it fails.  
I’ve MS Exchange with authentication and without ssl/tls. Test sending via telnet works fine.  
I’ve added username and password to keystore:

```auto
/usr/share/opensearch/bin/opensearch-keystore list
keystore.seed
plugins.alerting.destination.email.Opensearch.password
plugins.alerting.destination.email.Opensearch.username

```

(My sender name in dashboards calls “Opensearch”)

When I’m sending test email from dashboards, receiving exception:

```auto
[2022-04-20T04:55:24,274][ERROR][o.o.a.d.f.EmailDestinationFactory] [vdc01-petefk] Exception publishing Message: DestinationType: EMAIL, DestinationName: На почту, Host: cdc01-peexhub, Port: 25, Message: Monitor TEST Monitor just entered alert status. Please investigate the issue.
  - Trigger: TEST TRIGGER
  - Severity: 1
  - Period start: 2022-04-20T01:54:19.244Z
  - Period end: 2022-04-20T01:55:19.244Z
javax.mail.MessagingException: Can't send command to SMTP host
       at org.opensearch.alerting.destination.client.DestinationEmailClient.execute(DestinationEmailClient.java:100) ~[alerting-notification-1.2.4.0.jar:?]
        at org.opensearch.alerting.destination.factory.EmailDestinationFactory.publish(EmailDestinationFactory.java:52) [alerting-notification-1.2.4.0.jar:?]
        at org.opensearch.alerting.destination.factory.EmailDestinationFactory.publish(EmailDestinationFactory.java:39) [alerting-notification-1.2.4.0.jar:?]
        at org.opensearch.alerting.destination.Notification.lambda$publish$0(Notification.java:56) [alerting-notification-1.2.4.0.jar:?]
        at java.security.AccessController.doPrivileged(AccessController.java:312) [?:?]
        at org.opensearch.alerting.destination.Notification.publish(Notification.java:54) [alerting-notification-1.2.4.0.jar:?]
        at org.opensearch.alerting.model.destination.Destination.publish(Destination.kt:319) [opensearch-alerting-1.2.4.0.jar:1.2.4.0]
        at org.opensearch.alerting.MonitorRunner$runAction$2.invokeSuspend(MonitorRunner.kt:680) [opensearch-alerting-1.2.4.0.jar:1.2.4.0]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [kotlin-stdlib-1.3.72.jar:1.3.72-release-468 (1.3.72)]
        at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233) [kotlinx-coroutines-core-1.1.1.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) [kotlinx-coroutines-core-1.1.1.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) [kotlinx-coroutines-core-1.1.1.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742) [kotlinx-coroutines-core-1.1.1.jar:?]
[2022-04-20T04:55:24,275][INFO][o.o.a.m.MonitorRunResult] [vdc01-petefk002] Internal error: javax.mail.MessagingException: Can't send command to SMTP host. See the opensearch.log for details
java.lang.IllegalStateException: javax.mail.MessagingException: Can't send command to SMTP host
        at org.opensearch.alerting.destination.factory.EmailDestinationFactory.publish(EmailDestinationFactory.java:57) ~[alerting-notification-1.2.4.0.jar:?]
        at org.opensearch.alerting.destination.factory.EmailDestinationFactory.publish(EmailDestinationFactory.java:39) ~[alerting-notification-1.2.4.0.jar:?]
        at org.opensearch.alerting.destination.Notification.lambda$publish$0(Notification.java:56) ~[alerting-notification-1.2.4.0.jar:?]
        at java.security.AccessController.doPrivileged(AccessController.java:312) ~[?:?]
        at org.opensearch.alerting.destination.Notification.publish(Notification.java:54) ~[alerting-notification-1.2.4.0.jar:?]
        at org.opensearch.alerting.model.destination.Destination.publish(Destination.kt:319) ~[opensearch-alerting-1.2.4.0.jar:1.2.4.0]
        at org.opensearch.alerting.MonitorRunner$runAction$2.invokeSuspend(MonitorRunner.kt:680) ~[opensearch-alerting-1.2.4.0.jar:1.2.4.0]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [kotlin-stdlib-1.3.72.jar:1.3.72-release-468 (1.3.72)]
        at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:233) [kotlinx-coroutines-core-1.1.1.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594) [kotlinx-coroutines-core-1.1.1.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60) [kotlinx-coroutines-core-1.1.1.jar:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742) [kotlinx-coroutines-core-1.1.1.jar:?]
Caused by: javax.mail.MessagingException: Can't send command to SMTP host
        at org.opensearch.alerting.destination.client.DestinationEmailClient.execute(DestinationEmailClient.java:100) ~[alerting-notification-1.2.4.0.jar:?]
        at org.opensearch.alerting.destination.factory.EmailDestinationFactory.publish(EmailDestinationFactory.java:52) ~[alerting-notification-1.2.4.0.jar:?]
        ... 11 more

```

What did I do wron?

---

<div class="post-metadata">

**Author:** ![jathin12](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jathin12](https://forum.opensearch.org/u/jathin12)\
**Post date:** [April 20, 2022, 4:45pm UTC](https://forum.opensearch.org/t/cant-send-alerts-via-email/9285/2 "2022-04-20T16:45:59Z")

</div>

> [@anton](#):
>
> ```auto
> Can't send command to SMTP host. See the opensearch.log for details
> 
> ```

Do you see messages in opensearch.log?

---

<div class="post-metadata">

**Author:** ![anton](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@anton](https://forum.opensearch.org/u/anton)\
**Post date:** [April 21, 2022, 2:23am UTC](https://forum.opensearch.org/t/cant-send-alerts-via-email/9285/3 "2022-04-21T02:23:27Z")

</div>

That’s in my message. I’ve no another opensearch log.

---

<div class="post-metadata">

**Author:** ![harshitS](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@harshitS](https://forum.opensearch.org/u/harshitS)\
**Post date:** [July 20, 2022, 9:23am UTC](https://forum.opensearch.org/t/cant-send-alerts-via-email/9285/4 "2022-07-20T09:23:23Z")

</div>

@anton @jathin12 i am also facing the same issue.  
[link](https://forum.opensearch.org/t/alerts-are-getting-triggered-but-not-sending-email-notification/10309)  
could you please tell me how did you solved it or where i am going wrong

`

---

<div class="post-metadata">

**Author:** ![anton](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@anton](https://forum.opensearch.org/u/anton)\
**Post date:** [July 28, 2022, 7:58am UTC](https://forum.opensearch.org/t/cant-send-alerts-via-email/9285/5 "2022-07-28T07:58:38Z")

</div>

I still can’t solve this.
