下载的javamail部分与原始gmail邮件内容不同
我正在使用 javamail (imap) 实现电子邮件客户端。
电子邮件的某个“部分”的内容(仅在某一点)与我在 Gmail 中的原始电子邮件中看到的内容不同。这会导致链接断开,在示例中是具有两个点的链接。
该消息通过part.writeTo(System.out);打印到控制台。
怎么会这样……知道出了什么问题吗?帮助表示感谢!
// MimeMessage
if(part.getContentType().toLowerCase().startsWith("text/html")) {
// both, (String)part.getContent() and MimeUtility.decode as below
// and also writeTo contains the additional point..
part.writeTo(System.out);
// htmltext.append((String)part.getContent());
String body = IOUtils.toString(MimeUtility.decode(new ByteArrayInputStream(((String)part.getContent()).getBytes()), "quoted-printable"),"UTF-8");
htmltext.append(body);
}
所有其他邮件均已正确获取。
I am implementing a emailclient with javamail (imap).
There is a "part" of an email where the content is (at one point only) different from what i see on the original email in gmail. This leads to a broken link, in the example a link with two points.
The message is printed to the console with part.writeTo(System.out);
How can that be.. any idea what goes wrong? Help appreciated!
// MimeMessage
if(part.getContentType().toLowerCase().startsWith("text/html")) {
// both, (String)part.getContent() and MimeUtility.decode as below
// and also writeTo contains the additional point..
part.writeTo(System.out);
// htmltext.append((String)part.getContent());
String body = IOUtils.toString(MimeUtility.decode(new ByteArrayInputStream(((String)part.getContent()).getBytes()), "quoted-printable"),"UTF-8");
htmltext.append(body);
}
All other mails are fetched correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论