# Monitoring Email Connection Status

**URL:** <https://discourse.nodered.org/t/monitoring-email-connection-status/62479>\
**Category:** General\
**Created:** [10 May 2022 21:52 UTC](https://discourse.nodered.org/t/monitoring-email-connection-status/62479 "2022-05-10T21:52:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![als7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/als7/32/61414_2.png) [@als7](https://discourse.nodered.org/u/als7)\
**Post date:** [10 May 2022 21:52 UTC](https://discourse.nodered.org/t/monitoring-email-connection-status/62479/1 "2022-05-10T21:52:27Z")

</div>

Hi there,

I need to find a way to monitor the email in node (from [node-red-node-email](https://flows.nodered.org/node/node-red-node-email)) to see if the node is still connected or having connection problems and if it is disconnected, to send me an alert.

One of the problems I am having is that it can't just send me an alert if it has trouble connecting one time but is fine the next time (which happens quite a bit), so I only want it to send an alert if it has a connection issue lets say 5 times in a row.

I've tried using a catch node with the email node being the monitored node, followed by a [node-red-contrib-timed-counter](https://flows.nodered.org/node/node-red-contrib-timed-counter) node which I then set to a few seconds more than the number of times I want it to fail before notifying me. Then I pass that into a function node which checks if msg.count == 5 and if so, returns msg (that could be completely incorrect logically, I'm not sure).

So, for example, if I check the email every 10 seconds, I set the timed counter to 55 seconds, and if it counts to 5 (5 failed checks in a row), then I want it to satisfy the condition in the function, and send me an alert.

My issue -- I can't even figure out how to get an error message from the email node. I've tried a debug node with msg.error and msg.status just to see if it will even give me a print out, but nothing.

How the heck do I monitor this email node???

Any help would be extremely appreciated.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 May 2022 21:55 UTC](https://discourse.nodered.org/t/monitoring-email-connection-status/62479/2 "2022-05-10T21:55:41Z")

</div>

Have you tried pointing a status node at the email node?

Add a debug to the status node, set to show complete message & see what you get when it disconnects.

---

<div class="post-metadata">

**Author:** ![als7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/als7/32/61414_2.png) [@als7](https://discourse.nodered.org/u/als7)\
**Post date:** [11 May 2022 13:42 UTC](https://discourse.nodered.org/t/monitoring-email-connection-status/62479/3 "2022-05-11T13:42:09Z")

</div>

This was perfect. I can access the error message now through `msg.status.text` and check if it's `=== "email.status.connecterror"`. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 May 2022 13:42 UTC](https://discourse.nodered.org/t/monitoring-email-connection-status/62479/4 "2022-05-25T13:42:16Z")

</div>

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