Multiple msg.objects when querrying email inbox

Hi Forum, I am trying to querry my email inbox and import the data from those mails. This works fine so far if I tell a function node to look for a specific msg.topic.

  • node-red-node-email v1.12.3

But I am recieving a msg.object per mail in my inbox. Unfortunatly my javascripts skills are too bad to figure out how to access the first msg.object and save the information to variable1, going on to the next msg.object saving that information to variable2.

Hope someone can help me on track I guess its just the understanding of how those msg.objects can be addressed.

Thank you for your reply in advance!

You probably will not need javascript for this task. You could filter the topic with a simple switch node connected to the email node and the outputs go to different paths based on the content of msg.topic

1 Like

It isn't clear to me exactly what you want to do. What do you want to do with the emails once you have received them?

I think I have a mistake in reasoning here ... I do not need to do anything - it just ran X times if I got X messages ...

Thank you rko this node does what my javascript is doing if I already know the content of msg.topic :slight_smile: nice to know it would have been that easy.

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