UiPath Mail Activities: For Each Email: Invalid URI: The format of the URI could not be determined

I will try to explain the problem I’m having.

I need to build an automation to loop through emails and do something with it if the subject has some predefined words and has an attachment, and here is where my problem begins.

I tried almost every activity version from 1.9.3 to 1.12.3 and in every version when I use the For Each Email Activity I couldn’t use the attachments property (every e-mail returns 0 attachments). Then I found the version 1.13.1-preview, and in this version the For Each Email Activity has a new parameter (retrieve attachments) that solved my problem above, BUT, a new problem has appeared and this time I really think is a bug.

I ran the automation through a lot of emails, and in some emails I had a problem when the parameter Retrieve Attachments is set to true, I get the error on the title on the For Each Email Activity. To the best of my knowledge, the only thing I could find in every email that thrown this error is that they all have a url protector in its body (https://urldefense.com/v3/__https://drive.google.com.....) and its the only thing that made sense to me about this error, can you look into this problem please? :pleading_face: :pleading_face: :pleading_face:

Update1: After some more tests, I could run the For Each Email successfully inside an Use Outlook App, but if I use the Use Outlook 365 it fails with the mentioned error.

Update2: I also got an en email digitally signed that the For Each Email don’t recognize (only inside Use Outlook 365, inside Use Outlook App it’s working), the only thing I noticed that is different in this email, is that it’s digitally signed.

Update3: None of this problems occur when using the UiPath.MicrosoftOffice365.Activities.

Hey @anon58427373

What’s d method you are currently using to retrieve ?

Hi @Nithinkrishna

I’m using the activity For Each Email to loop through the emails, to save the attachments I’m using the Save Email Attachments activity, but to check if the email has an attachment, I’m using the method “attachments” from the email variable.

1 Like

Hi @anon58427373,
What Studio version are you using?
In case you are using a 2021.10 version, could you please try do the same automation but in the compatibility mode “Windows”, and let us know if it works ?
You can select it when creating a blank process:

Hi @Dumitrita_Crasnojon,

I’m using the version 2020.10.6, and in this version I don’t have the compatibility mode.

I tried using the activities in another blank process, but unfortunately it gave the same error.

I solved my automation using the UiPath.MicrosoftOffice365.Activities, but the UiPath.Mail.Activities was by far faster then the 365 activities, so I’m still trying to find out a way to use it.

Thanks, @anon58427373 .
On Windows-Legacy projects, UiPath.Mail.Activities works on a different API, which has not been supported by Microsoft for a long time, thus the results given might be incomplete or return errors as in your case.
As of 2021.10 Studio version, in projects created with Windows compatibility mode, UiPath.Mail.Activities runs with Graph API, which is more effective, and should not bring you any issues.

We advise you to continue using the UiPath.MicrosoftOffice365.Activities for now. We will work on improving the performance in the upcoming release(s).

Thanks @Dumitrita_Crasnojon.

Nice to know about this differences, I’ll keep that in mind when working with e-mails again.

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