Here's my Google App Script code:
var messages = threads[x].getMessages();
for (var y in messages)
{
messages[y].forward("someone@example.com");
}
This forwards fine, but it resets the from
field of message to the email id of account which executes the script. This removes all credentials of the original sender of message
. How to forward the email more elegantly such that all original headers (at least from
and to
) are retained? If the original message was sent to a list of people or a newsgroup, I need to retain it in the forwarded message.