How to get mail body content for reply mail using Regex Expression

Hi Team,

I am working on reading mail body from mail so, my current scenario i can receive reply or forward mails in this case i am able get full body of mail but issues is i need to get recent reply mail body content in mail.

Please find below screenshort of mail

image

Regards,
Neelima.

Hello

  • Have you got a sample (paste in a reply) - save us typing :wink:
  • Can you confirm the expected Output
  • Tell us about the pattern of the text.
1 Like

Thank you for your response, This Sample mail body from Reply mail
For example:

Thank you for changing password.

From: P venugopal
Sent: Thursday, October 15, 2020 7:15 PM
To: Shaik Mohammad Mahamm. Raphi
Subject: Password reset

Hi Team,

Kindly change the my password.

User name: gneelima.

Regards,
Neelima.

Expected Output: Text should be anything but i need to get mail content from recent reply or forward mail
How to get mail content i.e., Thank you for changing password.

Ignore remaining content in mail body

Kindly suggest me

Thanks!

Would something like this do?

(.|\n)+(?=From:(.|\n)+Sent:)

image

2 Likes

Is this what you needed @1996?

Or did you need something else?

Please Check below screenshot- but I am unable to get recent mail content from body.

Thanks!

Test this instead: (.|\n)+?(?=From:(.|\n)+Sent:)
It will give you several matches if there’re several “From Sent” in the text. Just pick the first match or use RegEx.Match().


image

1 Like

Good day @1996
Did you get the solution? Which Email service provider are you using for the email retrieval process?

Thank You, It is Working Fine.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.