Email node issue

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

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

Can anyone help me out

Thank you!

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

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

try this change node before email node

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

[{"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

if you can post the flow, it will help

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