Get the actual email message that the person just wrote, excluding any quoted text

后端 未结 6 1227
我寻月下人不归
我寻月下人不归 2020-12-23 17:34

There are two pre-existing questions on the site. One for Python, one for Java.

  • Java How to remove the quoted text from an email and only show the new text
6条回答
  •  长情又很酷
    2020-12-23 18:04

    There are many libraries out there that can help you extract the reply/signature from a message:

    • Ruby: https://github.com/github/email_reply_parser
    • Python: https://github.com/zapier/email-reply-parser or https://github.com/mailgun/talon
    • JavaScript: https://github.com/turt2live/node-email-reply-parser
    • Java: https://github.com/edlio/EmailReplyParser
    • PHP: https://github.com/willdurand/EmailReplyParser

    I've also read that MailGun offers a service to parse inbound email and POST its content to a URL of your choice. It will automatically strip quoted text from your emails: http://blog.mailgun.com/handle-incoming-emails-like-a-pro-mailgun-api-2-0/

    Hope that helps!

提交回复
热议问题