# Email node issue

**URL:** <https://discourse.nodered.org/t/email-node-issue/68075>\
**Category:** General\
**Created:** [22 September 2022 11:19 UTC](https://discourse.nodered.org/t/email-node-issue/68075 "2022-09-22T11:19:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MiliH](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@MiliH](https://discourse.nodered.org/u/MiliH)\
**Post date:** [22 September 2022 11:19 UTC](https://discourse.nodered.org/t/email-node-issue/68075/1 "2022-09-22T11:19:52Z")

</div>

Hello,  
At time of sending email, when I configure "TO" email address in email node at that time email body is received in email.

But when I configure "TO" email address in function node as msg.to at that time email is received in attachment format. Please find below snap:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/5/d529472a88962904626d353a1773f80eb446f2a9.png)

In conclusion, if I want to set dynamic email address how should I set it?

Can anyone help me out

Thank you!

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [22 September 2022 12:31 UTC](https://discourse.nodered.org/t/email-node-issue/68075/2 "2022-09-22T12:31:55Z")

</div>

msg.to will give dynamic address it should be a string with ; separator just as you would do in mail  
ensure to keep to in the email node EMPTY.  
msg.payload will be body of email  
msg.topic will be subject line  
msg.cc will have CC

---

<div class="post-metadata">

**Author:** ![MiliH](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@MiliH](https://discourse.nodered.org/u/MiliH)\
**Post date:** [22 September 2022 12:34 UTC](https://discourse.nodered.org/t/email-node-issue/68075/3 "2022-09-22T12:34:06Z")

</div>

if I am using To email address in function node then email body is not displayed in email instead email body is stored in one file and that file is receivied as an attachment in the email

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [22 September 2022 12:35 UTC](https://discourse.nodered.org/t/email-node-issue/68075/4 "2022-09-22T12:35:55Z")

</div>

try this change node before email node

ensure email addresses are valid, i have put some dummy ids

```auto
[{"id":"3d7cd233f5c93500","type":"change","z":"281cdefb6b284529","name":"Mail to team","rules":[{"t":"set","p":"to","pt":"msg","to":"emailaddress1@gmail.com;emailaddress2@gmail.com;","tot":"str"},{"t":"set","p":"cc","pt":"msg","to":"emailaddress3@gmail.com;emailaddress3@gmail.com;emailaddress3@gmail.com;","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"THIS WILL BE SUBJECT","tot":"str"},{"t":"set","p":"attachments","pt":"msg","to":"[\t {\t \"filename\": fn,\t \"content\": payload\t }\t]","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"'This will be body of mail and you can add dynamic content with '&msg.payload1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":1080,"wires":[[]]}]

```

keep to field empty in e-mail node  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/5/65be88fab328197a4cd06af6d68128386de16f81.png)

if you can post the flow, it will help

---

<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:** [6 October 2022 12:36 UTC](https://discourse.nodered.org/t/email-node-issue/68075/5 "2022-10-06T12:36:12Z")

</div>

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