Insert Inline Images in Gmail with Apps Script

The GmailApp service of Google Apps Script lets you easily read and process email messages from Gmail. You can use this to forward Gmail messages, to save email to your Gmail Drive in HTML or PDF formats, Mail merge, or even for transferring emails from one Gmail account to another email account.

While GmailApp offers simple methods like sendEmail and forward() to forward existing Gmail messages, you need to update the HTML Mail if the message body contains inline images. This is only required for inline images and not externally hosted image files that have been embedded into Gmail.