Sending inline image to Gmail - A question and request for help

Thanks for reading.

I am struggling to understand why I cannot seem to get an inline image to appear in GMail.

Having inserted a Base64 stream of an image, I am able to send that to Hotmail and alike, however whatever else I try it will not be seen in Gmail.
All I see is CAT_IMAGE with the typical missing graphic icon before it.

Debugging code at both ends, in K9 and in Gmail these are my results.

I would greatly appreciate any suggestions / guidance, etc, on this.


a) In K9

The message seems to me sending as a Mime message fine.

MIME Header

Date: Thu, 04 Apr 2024 14:04:48 +1000
To: My Name <>
Subject: Test Image 18
X-Priority: 3
User-Agent: K9 for Android
Message-ID: <>


Other information that may be helpful is as follows ;

            composedMimeMessage.addBodyPart(new MimeBodyPart(bodyPlain, "text/plain"));
            composedMimeMessage.addBodyPart(new MimeBodyPart(body, "text/html"));

simpleMessageFormat == SimpleMessageFormat.HTML  is  HTML

mimeType = multipart/mixed

String messageText = "<img src="data:image/png;base64,iVBORw0KGgoAAA.........AAALDGf//9D5EhiLEPUEK6AAAAAElFTkSuQmCC" alt="QR_IMAGE" width="100" height="100">"

textBodyBuilder = <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACAI..............EhiLEPUEK6AAAAAElFTkSuQmCC" alt="QR_IMAGE" width="100" height="100">

return textBodyBuilder.buildTextHtml(identity.getEmail(), receiverEmail);

simpleMessageFormat == SimpleMessageFormat.HTML  is  TEXT

messageContext =  <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACAI..............EhiLEPUEK6AAAAAElFTkSuQmCC" alt="QR_IMAGE" width="100" height="100">

return textBodyBuilder.buildTextPlain(identity.getEmail(), receiverEmail);


	message:  MimeMessage@14096
	mMessageId = <>


b) In Gmail

Gmail seems to be completely dropping the image. By this I mean all I get in Gmail is the following ;

<img alt="QR_IMAGE" width="100" height="100">

The odd thing is this. If I manually insert the the image code src="data:image/png;base64,iVBORw etc into the web browser via the developer console, the image then shows.

Thanks in advance.