I have a mail body like this
I need to open the second link in chrome, But the problem is both links look almost the same can anyone help me with this
I have a mail body like this
I need to open the second link in chrome, But the problem is both links look almost the same can anyone help me with this
Can you read email with html body and print the email body in write line & share that text here, so that we can help you on this?
@Ishan_Shelke
use regex fro particular word to particular word.
(?<=Network:(\s)).(?=Regards)
Hi,
Read the mail body into the string. Then use regex to find link from the body. You will get list containing links. You just need to iterate on that list.
Mark it as solution if it resolves your issue.
Thanks
Here it is
Dear Purchase Recon,
Please click on the below link to download your accounting report:
Generation Mode:Test Mode
https://api-v2.happay.in/transaction/v1/get-file-from-temporary-link/
If the above link is not accessible from our network:
https://api-v2.happay.in/transaction/v1/get-file-from-link/s3-ap-southeast-1.amazonaws.com
Regards,
Team Happay
(NEED TO EXTRACT THE SECOND LINK)
Is this below line is constant in the email body?
If the above link is not accessible from our network:
If yes then you can use below code to extract the 2nd URL from email body,
secondLink_URL(String DataType) = System.Text.RegularExpressions.Regex.Match( mailBody,"If the above link is not accessible from our network:\n(.*)", System.Text.RegularExpressions.RegexOptions.Multiline).Groups(1).Value.Trim
Find below screenshot for reference,
Hi @Ishan_Shelke ,
Could you maybe try the below Regex Expression :
https:\/\/.*
Expression :
System.Text.RegularExpressions.Regex.Matches(strInput1,"https:\/\/.*")(1).Value
Visuals :
Let us know if the method doesn’t work for your case.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.