# How to reply recived email in Node-Red

**URL:** <https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427>\
**Category:** General\
**Created:** [6 March 2022 06:48 UTC](https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427 "2022-03-06T06:48:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![iotgroup04](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@iotgroup04](https://discourse.nodered.org/u/iotgroup04)\
**Post date:** [6 March 2022 06:48 UTC](https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427/1 "2022-03-06T06:48:50Z")

</div>

I want to reply received email in Node-Red. I was able to read email & send new mail to the sender using [node-red-node-email](https://flows.nodered.org/node/node-red-node-email). But the sender see that as a new email. But I want to send it as reply instead of new email.

Thank you

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 March 2022 07:42 UTC](https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427/2 "2022-03-06T07:42:31Z")

</div>

Welcome to the forum @iotgroup04

I haven't done it but you could try setting `msg.replyTo` instead of `msg.to`, which is mentioned in the help text.

---

<div class="post-metadata">

**Author:** ![iotgroup04](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@iotgroup04](https://discourse.nodered.org/u/iotgroup04)\
**Post date:** [6 March 2022 07:56 UTC](https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427/4 "2022-03-06T07:56:27Z")

</div>

I tried it. When I remove the `msg.to` & add `msg.replyTo` it showd me a error `"Error: No recipients defined"`

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 March 2022 08:19 UTC](https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427/5 "2022-03-06T08:19:23Z")

</div>

Ah yes, you are right, that is telling it what to put in the replyTo field of the message it sends.

Sorry, I don't know how to do what you want.

---

<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:** [6 March 2022 08:50 UTC](https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427/6 "2022-03-06T08:50:06Z")

</div>

I'm not 100% sure these are passed through so use debug nodes set to show complete message to fully inspect the `msg` object that comes from the email in node. If you see something like `msg.messageId`...

Set `msg.inReplyTo` of the reply email to the value of `msg.messageId` you get from the incoming email.

Also, you might need to adjust the subject & suffix it with `"RE: "`

---

<div class="post-metadata">

**Author:** ![iotgroup04](https://avatars.discourse-cdn.com/v4/letter/i/f19dbf/32.png) [@iotgroup04](https://discourse.nodered.org/u/iotgroup04)\
**Post date:** [6 March 2022 09:54 UTC](https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427/7 "2022-03-06T09:54:29Z")

</div>

Thank you very much @Steve-Mcl . It worked. There is a field as `msg.header.message-id` I put it into `msg.inReplyTo` & change the subject(`msg.topic`) as you said. Thanks again. If you can change `msg.messageId` to `msg.header.message-id` in your answer it will be helpful to future readers. I have accepted you comment as the answer.

---

<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:** [20 March 2022 09:54 UTC](https://discourse.nodered.org/t/how-to-reply-recived-email-in-node-red/59427/8 "2022-03-20T09:54:31Z")

</div>

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