微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何通过 IMAP 将电子邮件正文与呈现的线程分开?

如何解决如何通过 IMAP 将电子邮件正文与呈现的线程分开?

我正在使用 IMAP 获取电子邮件,但是当我们呈现特定的邮件正文时,它会同时获取所有回复/对话。我想将这些消息分开,还想将特定的消息正文与签名分开。

我现在收到的

enter image description here

enter image description here

我想要达到的目标

enter image description here

enter image description here

第一封邮件的 HTML 正文,即收到的邮件

"<div style=\"padding-bottom: 20px;\"></div><div><html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title></title>\n</head>\n<body>\n<div dir=\"ltr\">\n<div>hey Bhavin,<br />\n<br /></div>\nThis is LA TEST 01 to test threads for Letter<br clear=\"all\" />\n<div>\n<div><br />\n--<br />\n<div dir=\"ltr\" class=\"gmail_signature\" data-smartmail=\n\"gmail_signature\">\n<div dir=\"ltr\">\n<div>\n<div dir=\"ltr\">----------<br />\n<span style=\"font-family:georgia,serif\"><font size=\"2\">Thanks &amp;\nRegards</font><br /></span></div>\n<div>Stack<br /></div>\n<div dir=\"ltr\"><span style=\"font-family:georgia,serif\"><font size=\n\"2\"><i><br /></i></font></span></div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</body>\n</html>\n</div>"

第二封邮件的 HTML 正文,即回复

"<div style=\"padding-bottom: 20px;\"></div><div><html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title></title>\n</head>\n<body>\n<div class=\"ydp462b3c77yahoo-style-wrap\" style=\n\"font-family: verdana,helvetica,sans-serif; font-size: 13px;\">\n<div>\n<div dir=\"ltr\" data-setdir=\"false\">Hi Stack,<br />\n<br />\nThanks for the info. Let me do the test for LA TEST 01 from my side\nas well.<br /></div>\n<div><br /></div>\n<div class=\"ydp462b3c77signature\">\n<div style=\n\"font-family:verdana,sans-serif;font-size:13px;\">\n--<br />\n<div><font size=\"2\">Thanks &amp; Regards</font></div>\n<div><b>Bhavin Bhadani</b></div>\n<div id=\"ydp267338c6yui_3_16_0_ym19_1_1469425690897_2386\">\n<font size=\"2\"><i>iOS Developer&nbsp;</i></font><font face=\n\"Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif\"><br />\n</font></div>\n<div><font size=\"2\"><i><b>skype:</b>\nbhavi</i></font></div>\n</div>\n</div>\n</div>\n<div><br /></div>\n<div><br /></div>\n</div>\n<div id=\"yahoo_quoted_4513314037\" class=\"yahoo_quoted\">\n<div style=\n\"font-family:\'Helvetica Neue\',sans-serif;font-size:13px;color:#26282a;\">\n<div>On Wednesday,23 June,2021,12:09:22 pm IST,Stack Help\n&lt;stackh@gmail.com&gt; wrote:</div>\n<div><br /></div>\n<div><br /></div>\n<div>\n<div id=\"yiv6922098475\">\n<div dir=\"ltr\">\n<div>hey Bhavin,<br />\n<br /></div>\nThis is LA TEST 01 to test threads for Letter<br clear=\"all\" />\n<div>\n<div><br />\n--<br />\n<div dir=\"ltr\" class=\"yiv6922098475gmail_signature\">\n<div dir=\"ltr\">\n<div>\n<div dir=\"ltr\">----------<br />\n<span style=\"font-family:georgia,serif;\"><font style=\n\"background-color: inherit;\" size=\"2\">Thanks &amp;\nRegards</font><br /></span></div>\n<div>Stack<br /></div>\n<div dir=\"ltr\"><span style=\n\"font-family:georgia,serif;\"><font style=\n\"background-color: inherit;\" size=\n\"2\"><i><br /></i></font></span></div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</div>\n</body>\n</html>\n</div>"

我在 iOS 上使用 MailCore 2,在 Android 上使用 JavaMail

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。