与电子邮件签名中的图像执行有关的一些问题? [英] Some questions related to implementation of image inside email signature?

查看:160
本文介绍了与电子邮件签名中的图像执行有关的一些问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用image实现电子邮件签名。现在我们只支持已经在工作的电子邮件签名中的文本。我需要提供功能
,我可以在邮件签名中插入图像。我可以发送电子邮件给我的应用程序中的用户,也可以发送给外部邮件域的用户,如gmail,yahoo等。当
邮件发送到我的应用程序系统中的一些用户时,系统使进入数据库,当接收者接收收件箱(内部从db读取邮件)。现在如果用户
将邮件发送到gmail上的外部用户,则使用javax mail api。 Similary我可以收到来自外部邮件域(gmail,yahoo等)的电子邮件现在我有
几个问题基于tis要求: -



1 )有什么标准,像gmail这样的外部邮件域如何将签名中的图像发送到另一个域(如我的应用程序邮件域)?
另外一点与此相关,gmail用户可以有两个图像,一个用于签名,另一个图像在body内。我如何确定哪个图像属于
签名?是否有任何定义的属性?



2)还不能弄清楚什么是最好/一致的发送方式(无论是内部应用程序用户或外部邮件域用户)包含
映像的电子邮件签名,以便在用户收到邮件时正确呈现?



在我的想法第2点: - 我以前以为我可以使用解决方案建议在如何以jsp?显示图像?其中
带有标签< .img src =/ getImage.action?imageId = 123> ,我可以从动作类或servlet中的数据库获取映像并返回。但是请记住
一旦我发送邮件给用户在gmail,他将无法访问servlet.So这种方法似乎不符合要求。
然后我碰到另一个很棒的stackoverflow链接
电子邮件签名中的base64编码的图像 Tim Medora的
解决方案看起来很棒,但是再次,解决方案下面的 Gmail似乎不支持 再次结束我的民谣
真的我认为我应该做完邮件域,如gmail,yahoo支持解决方案建议,因为在这种情况下,我可以发送图像为base64字符串而不是
的图像作为附件。 p>

如果您能够提供关于点1和2的指针/方法,那么人们将非常感激。

解决方案

要在电子邮件中包含图像,首先必须将图像作为MIME附件包含在电子邮件中。每个这些附件必须有一个Content-ID标题。

   -  f46d0444ea0d6991ba04b91c92e6 
内容类型:图像/ GIF; name =theImage.gif
Content-Transfer-Encoding:base64
Content-ID:< theImage @ abcd>

[base64 string]
--f46d0444ea0d6991ba04b91c92e6--

2)然后,在电子邮件中,将<-c $ c> src 属性中的Content-ID添加到< img> 标签。

 < img src =cid:theImage @ abcd/> 


i need to implement the email signature with image.As of now we only support the text in email signature which is already working.i need to provide the functionality where i can insert the image inside mail signature. i can send the email to user within myapplication and also to user on external mail domain like gmail,yahoo etc. When mail is sent to some user with in my application system, system makes entryt o DB and when receiver receives in inbox (which internally read the mail from db). Now if user send the mail to external user on gmail it makes use of javax mail api . Similary i can receive the email from external mail domains(gmail,yahoo etc) Now i have few questions based on tis requirement:-

1)Is there any standard for how the external mail domains like gmail send the image inside signature to another domains like (my application mail domain)? Another point related to it gmail user can have two images ,one for signature and another image inside body. How will i determine which image belongs to signature? Is there any defined property for that?

2)Also not able to make out what is the best/consistent approach to send(whether to internal application user or external mail domain user ) the email signature containing image so that it renders correctly when user receives it?

what I had in my mind for point 2:- i earlier thought i can use solution suggested at How to display an image in jsp?. where with tag <.img src="/getImage.action?imageId=123">, i can fetch the image from db in action class or servlet and return. But keeping in mind once i send the mail to the user on gmail , he will not be able to access the servlet.So this approach does not seems to fit in requirement. Then i came across the another great stackoverflow link base64 encoded images in email signatures where solution by Tim Medora looked great but again the comment below the solution Gmail doesn't seem to support it again ended my Folks really i think i should be done if mail domain like gmail,yahoo support the solution suggested by because in that case i can send image as base64 string instead of image as attachment.

Folks would be really grateful if you can provide me some pointer/approach regarding both points 1 and 2

解决方案

To include images in the email message, first you have to include the images as MIME attachments in the email. Each of these attachments must have a "Content-ID" header.

--f46d0444ea0d6991ba04b91c92e6
Content-Type: image/gif; name="theImage.gif"
Content-Transfer-Encoding: base64
Content-ID: <theImage@abcd>

[base64 string]
--f46d0444ea0d6991ba04b91c92e6--

2) Then, in the email message, include the Content-ID in the src attribute of the <img> tag.

<img src="cid:theImage@abcd" />

这篇关于与电子邮件签名中的图像执行有关的一些问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆