本文介绍了未显示Gmail图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,为了安全起见,Google宣布Gmail将使用代理加载外部图像.这会导致我的应用程序在以gmail显示图像时出现问题.

Gmail图像元素检查:https://ci5.googleusercontent.com/proxy/N4RZncgANd5glVi64ElKxecSE10SH6iAhu2VKOK3jJtgaRKBUsqwOn6iDwY49unvlD9Xi6cSZp0T4u1N_KHhBY-TxFaV8-v/-#1/-0/rep-rep/rep1rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep1rep-rep-rep/rep-rep/rep1rep-rep/rep-rep/rep-rep/rep-rep/rep-rep/rep1rep-rep/rep-rep/rep-rep/rep-rep/rep1-rep /p>

按照上述方法,HTML实际图像URL前面带有一个Google代理URL,以阻止显示图像.如果我们删除此垃圾URL,则图像开始看起来不错. Apple Mac Mails不会出现相同的问题.

我们提供了使用Java Mailing API的邮件发送功能.请提出建议.

谢谢,Divya Garg

解决方案

这里的问题是您用于邮件发送的URL.从提供的信息来看,它似乎是:

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

这是一个引用本地计算机上文件的URL.但是,该URL(而不是实际图像)将传递给Google的代理进行检索. Google无法从其代理访问该URL,因此该图像将不会显示.

解决方案是确保您正在使用的路径是本地网络外部可访问的路径;例如,通过将图像托管在面向外部的服务器上.

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

解决方案

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.

这篇关于未显示Gmail图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 23:19