有没有办法将消息指示为对另一条消息的回复消息,而不是在 MimeMessage class 中使用 reply() 方法

Is there way to indicate a message as a reply message to another message rather than using reply() method in MimeMessage class

我想使用 javax.mail api 发送一条消息作为对另一条消息的回复。我无法保留原始消息。因此,我不能使用 消息 replyMessage = new MimeMessage(session);
replyMessage = (MimeMessage) Originalmessage.reply(假);

但是,我可以保留所有 headers 的原始消息。有没有办法使用 headers 或 javax.mail api 将一条消息标记为对另一条消息的回复。

执行回复方法的操作:

The "Subject" field is filled in with the original subject prefixed with "Re:" (unless it already starts with "Re:"). The "In-Reply-To" header is set in the new message if this message has a "Message-Id" header. The ANSWERED flag is set in this message. The current implementation also sets the "References" header in the new message to include the contents of the "References" header (or, if missing, the "In-Reply-To" header) in this message, plus the contents of the "Message-Id" header of this message, as described in RFC 2822.