# Send an email once a day

**URL:** <https://discourse.nodered.org/t/send-an-email-once-a-day/97683>\
**Category:** General\
**Created:** [18 June 2025 12:50 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683 "2025-06-18T12:50:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [18 June 2025 12:50 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/1 "2025-06-18T12:50:09Z")

</div>

Hi,  
I am trying to send an email once a day using the trigger node but it is not working, is the trigger node able to do this without an input or does it require an inject node to start it off and if that is the case do I have to start it with a click to the inject node every time the system has been off ?

 ![24HrTrigger](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e89112fc5496adb940fd96330e4d219b1122f578.png)

Thanks  
Stuart

---

<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:** [18 June 2025 13:26 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/2 "2025-06-18T13:26:34Z")

</div>

Inject nodes is what you need with a suitable setting for the time you want it to occur (see the settings on the inject node at the bottom regarding timing)

Alternatively, you can install the highly customisable node-red-contrib-cron-plus for much greater control.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [18 June 2025 13:36 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/3 "2025-06-18T13:36:09Z")

</div>

The way you have the trigger node set up it will send the first message it receives (eg from an inject), then nothing for 24 hours, then one more message.  
After that another incoming message will be sent on straight away and reset the trigger.

So it would be possible to have a message passed on at  
25-06-2025 00:00:01, then resent at  
26-06-2025 00:00:01, and if a new message arrives at  
26-06-2025 01:05:00 and then it's resent at  
27-06-2025 01:05:00.

There is an option in the trigger node to resend every 24 hours

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/71d237efb68dc8213b44289f960381fbc4ba837b.png)

However, you might end up with multiple parallel message queues waiting their own 24 hour period. To avoid it you could set msg.reset in each incoming message.

I think the queued message would be lost in the event of a deploy or Node-red restart.

Depending on the data you are emailing it's probably simpler to have an inject node set to fire at a specific time every day.

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [18 June 2025 14:29 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/4 "2025-06-18T14:29:53Z")

</div>

Hi Jbudd,  
I have no incoming message, basically I have a formatted email with the contents of global variables, so it sends the current temperatures via email, I just need to automate sending them

Thanks  
Stuart

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [18 June 2025 14:39 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/5 "2025-06-18T14:39:12Z")

</div>

Hi,  
I have tried an inject node, however it sends emails every time I do a deploy so I guess it is starting a fresh ?

 ![24Hrs](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/9/792126a64767580751d40d5142df3ed6298c465a.png)

Thanks  
Stuart

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [18 June 2025 14:46 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/6 "2025-06-18T14:46:56Z")

</div>

> [@acestu](#):
>
> I have no incoming message, basically I have a formatted email with the contents of global variables

Umm.  
Well the temperature data arrives in Node-red somehow.

Use an inject node eg set to fire at 14:00 every day, or cron-plus. This is not "every 24 hours"

There are other solutions but the two above will work regardless of deploy/reboot, so long as the device is running at the inject time.

---

<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:** [18 June 2025 15:07 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/7 "2025-06-18T15:07:15Z")

</div>

> [@acestu](#):
>
> I have tried an inject node, however it sends emails every time I do a deploy so I guess it is starting a fresh ?

Because you have "inject once after 0.1 seconds" ticked.

also, you are probably doing a "FULL deploy" instead of "CHANGED NODES ONLY deploy" - that causes all nodes to be destroyed and recreated (and therefore inject triggers again)

If you use "CHANGED NODES ONLY deploy" or disable "inject once after 0.1 seconds" or use `cron-plus` this wont happen

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [19 June 2025 07:37 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/8 "2025-06-19T07:37:06Z")

</div>

Hi Steve,

Thanks for the info, I have de checked the inject after box and will see how it goes, also the Deploy info was much appreciated, I will try and get my head around cron plus too as it looks like it can do a lot.

Thanks  
Stuart

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [19 June 2025 15:19 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/9 "2025-06-19T15:19:25Z")

</div>

Hi,

I found a great video on youtube that explains cron syntax which is really informative, I am now using cron plus for my shedule.

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fd5351d98119694c7ec92eb4f2787328c45a3a46.jpeg "Become an EXPERT in cron and node-cron!") ](https://www.youtube.com/watch?v=L0RYxPPMYQs)

Thanks  
Stuart

---

<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:** [3 July 2025 15:19 UTC](https://discourse.nodered.org/t/send-an-email-once-a-day/97683/10 "2025-07-03T15:19:27Z")

</div>

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