Edit message before forwarding

Skip to first unread message

Arkadiusz Alicki

Apr 4, 2024, 6:05:23 AMApr 4
to Google Apps Script Community

I need to get the last message from thread and forward it without message body (I need to forward attachments only). How can I edit message body before I send it? 

I need only attachments from the message, and currently attachments + inlineImages are being forwarded. 

I can not do it with .sendEmail() method, because i want to preserve thread history. 

Here's snippet of the code:

          lastMessage.forward(forwardingAddress, {
            from: fromAddress,
            subject: subject,

Arkadiusz Alicki

Apr 5, 2024, 5:49:02 AMApr 5
to Google Apps Script Community

To clarify: 

We have label in Gmail Inbox, and all those messages within that label should be forwarded to external Application. I created a time-triggered script which sends all those messages, but the problem is that Inline Images get send too (signature images, header images from message etc.) - I only need to forward PDF file attached to the mail, not with extra inline Images. 
Reply all
Reply to author
0 new messages