如何将回复的电子邮件与发送的邀请相匹配?(Java Mail) [英] How to match replied emails to the sent invitations?(Java Mail)

查看:154
本文介绍了如何将回复的电子邮件与发送的邀请相匹配?(Java Mail)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


所以我用Java Mail发送ICal邀请,我给他们每个Message-ID。
现在如果有人通过接受/拒绝回复,我收到回复电子邮件,但使用不同的Message-ID。

似乎Outlook会生成新的Message-ID,并抛出我在邀请中设置的每个标题,有没有办法将发送的邀请与他们的回复或其他方式相匹配?


So,I'm sending ICal invitations with Java Mail,I give each of them a Message-ID. Now if someone replies by accepting/declining, I get a reply email,but with a different Message-ID.
It seems Outlook generates new Message-IDs and throws away every header I've set in the invitation, is there any way to match the sent invitation to their replies or the other way around?

这是当我查找我的互联网标题的邀请时显示的内容:

Here is what it shows when I look up my internet header of the invitation:

Return-Path: 
X-Original-To: 
Delivered-To:
Received: from
by 
for   ; Tue, 15 Oct 2013 09:52:39 +0200 (CEST)
From:
To:
Message-ID: 11111111111111111111111111
Subject: TestMail 
MIME-Version: 1.0
Content-Type: multipart/alternative; 
boundary="----=_Part_0_694990101.1381823559402"
UID:  114442
ContentID: blabla

这是回复的标题如下:

Return-Path: 
X-Original-To: 
Delivered-To: 
Received: from 
for   ; Tue, 15 Oct 2013 09:52:44 +0200 (CEST)
From: 
To: 
Subject: Accepted: TestMail 11.10
Date: Tue, 15 Oct 2013 09:52:44 +0200
Message-ID: <000301cec97b$8866c540$99344fc0$@do@me.com>
MIME-Version: 1.0
Content-Type: text/calendar; method=REPLY;
charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac7Je4UCPB4Lb2ZERnCPQEx3IbfpbQAAAEBQAAAAkSA=
Content-Language: de


感谢您的任何帮助!


Thanks for any help in advance!

推荐答案

我知道了我需要阅读答复的正文,而不是标题。我设置的一切都存储在身体中。
要获取正文的内容,您必须获取inputStream,如下所示:

I got it! I needed to read the body of the reply and not the header. Everything I have set was stored in the body. To get the content of the body you have to get the inputStream, like this:

Folder folder = store.getFolder("Inbox");
folder.open(Folder.READ_WRITE);
Message message[] = folder.getMessages();
InputStream in = messages.getInputStream();

然后你只需要写一个典型的IO Reader来获取线条,分割它并取值你已经设置好了。

Then you just have to write a typical IO Reader to get the lines,split it and take the values you have set.That's it.

这篇关于如何将回复的电子邮件与发送的邀请相匹配?(Java Mail)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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