在不同区域设置中包含多个文本/html 的 Mime 消息
我目前正在构建 MimeMessage(Java 邮件)并将其发送给用户,但我们支持多个区域设置。在发送时,我们不知道最终用户可以理解哪种语言。
我想知道是否可以将多个文本/html 附加到不同语言的消息中。
即第一个 text/html 是英语,第二个 text/html 是德语,第三个是法语。
这可能吗?如果是这样,我是否需要添加一些标头来定义 html 所在的语言环境/语言?
谢谢 尼尔
I'm currently building up an MimeMessage (Java Mail) and sending it to users, but we support multiple locales. At the time of sending we dont know what language the end user can understand.
I was wondering if its possible to attach multiple text/html to the message which are in different languages.
I.e. the first text/html is English, the second text/html is German, the third is French.
Is this possible? If so do I need to add some header to define what locale/lang the html is in?
Thanks
Neil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试添加:
内容语言: en
内容语言:fr
内容语言:
对您的附件进行测试并使用主要电子邮件客户端(Outlook、Yahoo、Gmail...)进行测试
Try adding:
Content-language: en
Content-language: fr
Content-language: de
to your attachments and test with major email clients (Outlook, Yahoo, Gmail, ...)
您可能会想到两种方法。一种是用英语定义消息,并将其他内容添加为适当命名的附件(Deutsch.html、Francais.html 等)。您最终可能会遇到附件名称中非 ASCII 字符支持的问题。各种 MUA 可能无法正确处理它。
其他方法是将内容设为英文并添加多语言链接,如下所示:
这些链接将指向包含适当语言版本的消息的网页。我更倾向于第二种方法,因为它更可靠(尽管如果您想支持大量语言,这可能是一个问题)。
You may think of two approaches. One is to define a message in English and add other contents as appropriately named attachments (Deutsch.html, Francais.html and so on). You may end up with a problem with support of non-ASCII characters in attachment names. Various MUAs probably won't handle it correctly.
Other approach would be to put the contents in English and add multilingual links like this:
The links will point out to a web page with appropriate language version of a message. I am more inclined to second approach as it is more reliable (although it could be a problem if you want to support large number of languages).