Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Images not displayed for Gmail

Tags:

gmail

Recently Google announced that Gmail will load external images using a proxy for safety purpose. This causing an issue for my application while displaying images in gmail.

Gmail image element inspection: https://ci5.googleusercontent.com/proxy/N4RZncgANd5glVi64ElKxecSE10SH6iAhu2VKOK3jJtgaRKBUsqwOn6iDwY49unvlD9Xi6cSZp0T4u1N_KHhBY-TxFaV8PvPNSMn4A=s0-d-e1-ft#http://localhost:8080/email/thread/1301/images/correct) no-repeat">올바른 답변

As per above HTML actual image url is prepended with a Google proxy URL stopping images to be displayed. If we remove this garbage URL, image starts to appear fine. Same issue not appears for Apple Mac Mails.

We have provided mailing feature using Java Mailing API. Please suggest.

Thanks, Divya Garg

like image 218
Divya Garg Avatar asked Dec 30 '13 09:12

Divya Garg


1 Answers

The problem here is the URL you are using for your mailings. From the information provided, it appears to be:

http://localhost:8080/email/thread/1301/images/correct

This is a URL that refers to a file on your local computer. However, that URL - rather than the actual image - is being passed to Google's proxy to retrieve. Google has no way to access that URL from their proxy, and thus the image will not appear.

The solution is to ensure that the path you are using is one accessible outside of your local network; for example, by hosting the images on an externally-facing server.

like image 109
Adrian Wragg Avatar answered Nov 08 '22 19:11

Adrian Wragg