Android Question Send HTML email with pictures on server, not working.


Well-Known Member
Licensed User
Longtime User

I'm trying to use the email intent with an html page which has server side images and one attachment. The HTML looks like this:

<!DOCTYPE html>
<img src="<imglink>" alt="Product">

and the code:

Dim e As Email
e.Subject = "Test"
e.Body = html
e.Attachments.Add(File.DirRootExternal & "/pictures/QRcode.png")
'start html email

The attachment works but my img src stuff in the html not. When I start the intent I see "obj" in the message while i'm pointing to server side images in the html. Any suggestions?

I'm replacing the <imglink> with my server image URL's.

Phil Griffiths

New Member
Licensed User
Longtime User
I am trying to do something similar

I would like to give the attachment a content-id so that I can reference the attachment in HTML in the email text

For example:

in B4A

Dim email As Email
email.ContentMIMEType = ""message/rfc822"
Dim Attachment As EmailAttachment
Attachment.Filename = "picture.jpg"
Attachment.ContentId = "att1"

In HTML email message string

<!DOCTYPE html>
< html>
< body>
< img src="cid:att1" alt="Product">
< /body>
< /html>

Please can anyone give suggestions or point me at java code for Email so that I can work out how to implement this in a new or amended library?

many thanks
Upvote 0