Send emails with embedded images

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Send emails with embedded images

Postby andre1506345542 » Mon Sep 25, 2017 3:26 pm

Hi

I have a html string which contains embedded images. When I send those emails with the mail plugin or the mail pro plugin and you receive them in Outlook or Gmail the images are not visible. In outlook you get a red cross, in gmail there is nothing.
If I look to the source code of the email I see the embedded image code.

<img src="data:image/png;base64,iVBORw0KG...........AAABJRU5ErkJggg==" alt="" />

When I open the html string in a HTML_AREA the images are shown perfectly.
If I open the email in eM Client, I see the images perfectly.

I don't think it is a problem with the mail or mailpro plugin, but more the way that outlook handles the emails.

I do not want to store the images on the server separately as jpg files, but nicely embedded so I keep everything together.

Anyone an idea?

Thanks
Andre
andre1506345542
 
Posts: 42
Joined: Mon Sep 25, 2017 3:19 pm

Re: Send emails with embedded images

Postby patrick » Mon Sep 25, 2017 3:40 pm

afaik, outlook and most web based html clients will block such embedded images. With the MailPro plugin, you could go the old school approach of linking to the image via a reference to the attachment. It has some embeddAllImages or something like that.

Personally, I like remote loading of images best. It keeps the image small and it allows to track emails sent.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Send emails with embedded images

Postby andre1506345542 » Mon Sep 25, 2017 4:15 pm

Thanks Patrick,
But it does not look nice in your email signature, that your company and linkedin logo does not appear automatically and you have to click to download them.
It is nicer they show up right away.
I do this with my email client (eM Client) but my collegues also with outlook. We send embedded images in our signature, and works fine. So their must me a small difference in html coding.
I will check out the reference you mentioned.

BTW I downloaded the mailpro this morning, but their is no example included.
Can you send it to my, please.

thanks, all help and input is highly appreciated
Andre
andre1506345542
 
Posts: 42
Joined: Mon Sep 25, 2017 3:19 pm

Re: Send emails with embedded images

Postby patrick » Mon Sep 25, 2017 4:43 pm

are you sure you send the images as base64 source directly on the img tag and not as a reference to an attachment?

and sorry, there is no sample solution for MailPro. Just inline documentation (tooltips etc.).
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Send emails with embedded images

Postby andre1506345542 » Mon Sep 25, 2017 4:53 pm

Thanks
Yes I am sure.
See first message.
My eM Client (email application) shows the emails as intended. Outlook and Gmail does not.
I tried png and jpg.
Brdgs
Andre
andre1506345542
 
Posts: 42
Joined: Mon Sep 25, 2017 3:19 pm

Re: Send emails with embedded images

Postby patrick » Mon Sep 25, 2017 8:40 pm

Sorry, I wasn't clear. You said you send the images from your email clients embedded and it works fine. My impression is those clients do not send the images on the img tag, but as a reference to an attachment for which they set disposition=inline. Have a look at the source of a message that you sent from your mail client and that displays correctly in outlook.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Send emails with embedded images

Postby andre1506345542 » Tue Sep 26, 2017 1:20 pm

Hi,
The emails are sent with the servoy application.
If I receive them in my email client (eM Client) the see the embedded images. If I receive the emails in Outlook or Gmail I do not see the embedded images.
If it is ok with you I can send you an email to our email address. So you can see for yourself.
Brdgs
Andre
andre1506345542
 
Posts: 42
Joined: Mon Sep 25, 2017 3:19 pm

Re: Send emails with embedded images

Postby patrick » Tue Sep 26, 2017 2:25 pm

I understood that. I asked whether you have ever looked at a message that you send from outlook to outlook with the logo embedded in the signature. I'm pretty sure it won't be encoded data on the img tag. I think outlook simply does not support that.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Send emails with embedded images

Postby AlanBourke » Tue Sep 26, 2017 3:00 pm

Handling embedded images in a way that will work for any recipient is not as simple as it might appear, take a look at this: https://sendgrid.com/blog/embedding-images-emails-facts/

Also send your Gmail account an email from Outlook and then take a look at the raw message that is received. I just did this to my Fastmail account and an email with one image embedded plus one image for the signature is 98KB, all Base64, Microsoft's own VML markup and CSS.

I have had most success using the CID approach but you'll have to roll your own HTML. The approach you have detailed where you are inline embedding will be blocked completely in Outlook.
-------------------------------------------------------------------------------------------
Servoy SAN Developer
User avatar
AlanBourke
 
Posts: 198
Joined: Tue Aug 02, 2011 3:32 pm
Location: Dublin, Ireland

Re: Send emails with embedded images

Postby andre1506345542 » Tue Sep 26, 2017 3:33 pm

As far as I can see, Outlook uses cid.
I will check this out if can use this in our application.
thanks
andre1506345542
 
Posts: 42
Joined: Mon Sep 25, 2017 3:19 pm

Re: Send emails with embedded images

Postby AlanBourke » Wed Sep 27, 2017 12:18 pm

You may find that the CID approach will work fine with Outlook recipients (and possibly other desktop clients) but will just present the images as attachments in Gmail and the like.
-------------------------------------------------------------------------------------------
Servoy SAN Developer
User avatar
AlanBourke
 
Posts: 198
Joined: Tue Aug 02, 2011 3:32 pm
Location: Dublin, Ireland

Re: Send emails with embedded images

Postby andre1506345542 » Tue Oct 03, 2017 2:48 pm

Thanks,
I have changed the email process so he gets all base64 data, and converts it to CID. It works nice on most clients.
Thanks everyone.
Andre
andre1506345542
 
Posts: 42
Joined: Mon Sep 25, 2017 3:19 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 11 guests

cron