---
title: "[Solved] Inline images break when embedded from the htmlBody of an existing Gmail draft"
author: "Martin Hawksey"
date: 2021-02-09T15:21:00+00:00
modified: 2021-02-08T15:24:31+00:00
canonical_url: https://pulse.appsscript.info/p/2021/02/solved-inline-images-break-when-embedded-from-the-htmlbody-of-an-existing-gmail-draft/
markdown_url: https://pulse.appsscript.info/p/2021/02/solved-inline-images-break-when-embedded-from-the-htmlbody-of-an-existing-gmail-draft.md
categories:
  - "Beginner"
  - "Gmail"
  - "Snippet"
tags:
  - "stackoverflow"
featured_image: https://pulse.appsscript.info/files/2021/02/XuGn5.png
description: "Handy snippet from Andras Sztrokay to handle inline images when using Gmail draft messages as part of your script projects."
---

# [Solved] Inline images break when embedded from the htmlBody of an existing Gmail draft

![[Solved] Inline images break when embedded from the htmlBody of an existing Gmail draft](https://pulse.appsscript.info/files/2021/02/XuGn5.png)

> [https://stackoverflow.com/a/65813881/1027723](https://stackoverflow.com/a/65813881/1027723)

Handy snippet from Andras Sztrokay to handle inline images when using Gmail draft messages as part of your script projects. As [highlighted by Romain Vialard**](https://groups.google.com/g/google-apps-script-community/c/9KUjtIOUhi8/m/SXoEIK8lBgAJ) in the Google Apps Script community:

> *Google added the ability to easily retrieve the inline images in an existing draft via the `getAttachments()` method on October 30, 2018 (see [Apps Script release notes](https://developers.google.com/apps-script/releases/2018#october_30_2018))*

Source: *[Inline images break when embedded from the htmlBody of an existing draft [GmailApp] [Apps Script]*](https://stackoverflow.com/questions/65795503/inline-images-break-when-embedded-from-the-htmlbody-of-an-existing-draft-gmaila)

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2021/02/solved-inline-images-break-when-embedded-from-the-htmlbody-of-an-existing-gmail-draft/](https://pulse.appsscript.info/p/2021/02/solved-inline-images-break-when-embedded-from-the-htmlbody-of-an-existing-gmail-draft/)*
