Images not displayed for Gmail

百般思念 提交于 2019-12-03 12:28:03

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/20836911/images-not-displayed-for-gmail

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!