当前位置: 技术问答>java相关
请问如何在JAVAMAIL中显示图片,如果附件中不是图片,如何给它加上链接让用户下载呢?
来源: 互联网 发布时间:2015-03-18
本文导语: 请高手指教 | If the message came across as text/html content, just send the HTML out as the output of the JSP request. All the different IMG tags will make separate requests to the server to display the images. T...
请高手指教
|
If the message came across as text/html content, just send the HTML out as the output of the JSP request. All the different IMG tags will make separate requests to the server to display the images.
The only real problem is if the images come across with the JavaMail message and have a URL that begins with a cid: URL If that is the case, then you deal with sending the image yourself (and saving it locally). You can try to create a protocol handler for cid, but I think the best way is to convert the URL into one that is handled by default, like any other image, with an HTTP request.
The only real problem is if the images come across with the JavaMail message and have a URL that begins with a cid: URL If that is the case, then you deal with sending the image yourself (and saving it locally). You can try to create a protocol handler for cid, but I think the best way is to convert the URL into one that is handled by default, like any other image, with an HTTP request.