It seems like there is a problem with the forEach function used in the javascript action. forEach only works for Array, Map or Set. You may have to convert your item "e" into said types before applying the forEach function.
This is a program error, like Aditya mentions. You best take this up with the responsible party: the creator of the email-module. That is likely Mendix. So create a ticket at support.mendix.com, and add a testproject in which you reproduce the error.