The output of mail.body

Hello,

I have extracted mail.body but the output is in HTML and i have included Regex (?<= href=\W\S).*(?=\W\W\Shere) to extract the URL link to a variable ‘extracted’ but when i writeline/message box said variable, it shows up blank.

The same extracted HTML inputted on regex101 with my Regex extract exactly the link i want. Not sure why is the result showing blank on Uipath. Any help is appreciated :wink:

@Druidtier3,

What activity are you using to read mail Get Outlook Mail Message or Get Exchange Mail Message?
if you’re using Get Exchange Mail Message then select IsHTMLBody property and try.

otherwise, you could paste your mail body here.

Hi @Pankaj.Patil,

I am using the Get Mail Messages activity and Gsuite application scope.

{
“message”: " for a gasg hahsdf, which you can do <a style=‘font-size:12px; color: #fa5400; font-family:Helvetica, Arial, sans-serif; text-decoration:initial; font-weight: normal;’ href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Funite.adfas.com%2Fs3%2Funite%2Fupdategasg.html%3FhahsdfKey=93749947-50e7-4c18-8f54-20b27b6515c8%26locale=en_SG%26redirectUrl=http:%2F%2Fwww.adfas.com%26backendEnvironment=identity/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/wMv2xEUxdR1qlkhArtK-0WchfkQ=214”>here. This link will expire in 1 hour.

Your new gasg must include:

  • 8-36 characters
  • At least 1 mixed-case letter
  • At least 1 number
If you did not initiate this gasg hahsdf, please <a style=‘font-size:12px; color: #fa5400; font-family:Helvetica, Arial, sans-serif; text-decoration:underline; font-weight: normal;’ href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Fwww.adfas.com%2Fsg%2Fhelp%2F%23contact/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/62cgYRgxrIjRW6AQp7y-9Ofk0dU=214”>contact us.

Thanks,

adfas.com<td style=“border:none;”><table width=“100%” border=“0” cellpadding=“0” cellspacing=“0” style=“border:none; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;”><table width=“100%” border=“0” cellpadding=“0” cellspacing=“0” style=“border:none; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;”><td align=“left” bgcolor="#444444" style=“border:none; padding-top:14px; padding-bottom:14px;”><table border=“0” cellspacing=“0” cellpadding=“5” bgcolor="#444444" style=‘font-size: 12px; color: #ffffff; font-family:Helvetica, Arial, sans-serif; text-decoration:none; font-weight: normal; border:none;’><td width=“30” style=“border:none;”> <td align=“left” valign=“middle” style=“border:none;”><a href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Fagreementservice.svs.adfas.com%2Fsg%2Fen_sg%2Frest%2Fagreement%3FagreementType=privacyPolicy%26uxId=com.adfas.unite%26country=sg%26language=en%26requestType=redirect%26%3Fcp=gasghahsdf/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/ubCnRI-J5EiZdjv6Z7eKPfdT3Ag=214” style=‘color:#ffffff; text-decoration:none; white-space:nowrap;’>Privacy Policy<td align=“left” valign=“middle” style=“border:none;”><a href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Fwww.adfas.com%2Fsg%2Fhelp/1/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/aILkZwmoHZhZZPR4tew63bM_vjg=214” style=‘color:#ffffff; text-decoration:none; white-space:nowrap;’>Get Help<td width=“15” style=“border:none;”> <td bgcolor="#444444" style=“border:none; padding-top:14px; padding-bottom:14px;”><table border=“0” cellspacing=“0” bgcolor="#444444" width=“100%” style=‘font-size: 12px; color: #ffffff; font-family:Helvetica, Arial, sans-serif; text-decoration:none; font-weight: normal; border:none;’>© 2021 adfas All rights reserved.<table width=“100%” border=“0” cellpadding=“0” cellspacing=“0” style=“border:none; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;”><td bgcolor="#ffffff"><table border=“0” cellspacing=“0” cellpadding=“0” bgcolor="#ffffff" width=“100%” style=‘font-size: 12px; color: #666666; font-family:Helvetica, Arial, sans-serif; text-decoration:none; font-weight: normal; border:none;’><td width=“30” style=“border:none;”> <td align=“left” valign=“middle” style=“border:none; padding-top:20px; padding-bottom:30px;”>adfas European Operations Netherlands, B.V.
Colosseum 1, 1213 NL, Hilversum, The Netherlands

Please do not reply to this email. If you need to contact adfas
with questions or concerns, please <a href=“https://wtdmbt5c.r.us-east-1.awstrack.me/L0/https:%2F%2Fwww.adfas.com%2Fsg%2Fhelp%2F%23contact/2/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/heH8MfG3AyW8Gu8ZqoelGAQRcDI=214” style=‘font-size:12px; color: #fa5400; font-family:Helvetica, Arial, sans-serif; text-decoration:initial; font-weight: normal;’>click here.
<td width=“120” style=“border:none;”> <img alt="" src=“http://wtdmbt5c.r.us-east-1.awstrack.me/I0/0100017970e4b3d6-7f71eebd-fdd1-4de2-a59d-148a0e540c53-000000/Tp6by1efn-nFBON5za4KKDQTa90=214” style=“display: none; width: 1px; height: 1px;”>\r\n",
“level”: “Trace”,
“logType”: “User”,
“timeStamp”: “01:29:10”,
“processVersion”: “1.0.0”,
“jobId”: “ece44af3-4271-401f-8e1b-7525c481c62e”,
“robotName”: “asdff11@gmail.com-attended”,
“machineId”: 1352462,
“organizationUnitId”: 1338806
}

please refer to the info above info. I did a regex.match and it returns nothing. It managed to extract properly in regex101 though.
regex.match(content,"((?<= href=\W\S).*(?=\W\W\Shere))").ToString

please try
href=\W(.*?(?=\W\Where\. This link will expire in 1 hour))

1 Like

welcome to forum
hello i also face the same issues i have an idea to extract data from the mail body
use outlook mail the you can extract data easily

and if you get the solution please mark it as solution

Thanks
Chethan P

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