'Workaround to retreive E-Mails using Uipath

Uipath studio: 2021.10.3 Package Uipath.Mail.Activities: 1.3.0

Hi everyone,

My objective is to retrieve E-Mails from a particular E-Mail Address throught Uipath activities.

I use currently the activity "GetExchangeMailMessages" to retrieve the Emails and it works well. However, I got the following error over a period of time:

The request failed. The underlying connection was closed: An unexpected error occurred on a receive

Forgive me if I say something incorrectly, but my understandig is the exchange protocol was not available at that time. That is why I decided to find a Workaround when it happens again. The workarround was to used the procotocol IMAP.

Uipath has the activity "GetIMAPMailMessages" in order to retrieve E-Mails. I configured this activity with following settings:

  • Port: 993
  • Server: The same server that I used for the exchange protocol
  • SecureConnection: Auto

I am getting the following error:

The remote certificate is invalid according to the validation procedure

I do not have enough experience working with those protocols and I do not know how to have a valid certificate.

My question is: is the IMAP workarround an option for my first error?. If so, how could I solve the final error with the IMAP activity?.

Tks for your help in advance.



Solution 1:[1]

You can't fix the certificate error as the certificate is remote (i.e. belongs to the remote server you are trying to connect to).

What I would suggest is that instead of replacing your working Exchange activity, you place it inside a try/catch block. This will allow you to catch the exception thrown in the event it happens and handle it appropriately (which could of course include attempting to retrieve the mail messages through a different route, or waiting a short time and retrying the action)

Solution 2:[2]

I can recommend working with the Outlook Mail Message activities instead. My experience is that they are easier to set up and also have fewer errors. However there is a dependency in form of Outlook being installed on the server/machine running the automation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dave
Solution 2 glavman