Good day Everybody,
I need some assistance with extracting the first email body from the trail e,g..
This one above would be the first one that came in a trail.
How do I extract only the first message from the trail?
Good day Everybody,
I need some assistance with extracting the first email body from the trail e,g..
This one above would be the first one that came in a trail.
Use this regex to get everything before “From:” which is where second email starts.
^(.*?)(?=From:)
In Get email you can filter by something like Subject, From, CC or Subject or Body contains, so that you will get array of all mail messages from this trail.
Then sort it by received time and get first message.
Hi @ashokkarale ,
Thank you for the reply, The email I want is the one from the very bottom of the trail, using your example:
I would want this one in the bottom:
Can you try simple string split
mailbodystring.Split("From:")(mailbodystring.Split("From:").Length-1)
Hello, thank you for the response, The emails I get are dynamic it’s not always the same senders
After getting your email body in as single string, lets say you are emailbody stored in strEmailBody variable.
in assign activity you can below expression to get the last email
strEmailBody.Substring(strEmailBody.LastIndexOf(“From”))
This give you exact email what you are looking for like below image
Happy Automation!!
If you find the solution, mark it as solution!!
it worked thanks so much
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.