Get IMAP Mail Messages Timed Out While Waiting For Mail Service To Connect

How to resolve when IMAP Mail Messages obtains - Timed out while waiting for Mail Service to connect?

This article provides the resolution for error "Get IMAP Mail Messages: Timed out while waiting for Mail Service to connect" which might be obtained when trying to fetch mails from a Gmail account.

For fetching emails from the Gmail account through the IMAP protocol, make sure below requirements are first met:


If still an error persists in UiPath, try fetching through the below PS script. This script will print the subject of first ten emails. Update the respective details in the PowerShell script

![](upload://odbgKZeJ6f873iEiNe0tgJOgIdm.html)

Follow the below procedure to get imapx.dll: You can download the imapx from Manage Packages in UiPath

  1. Install IMAPX

![](upload://qqrMHXQQw9jDSeH4E3qXh8kWD0C.html)

  1. After installation you will find the dll in the below location C:\Users\YourUsername\.nuget\packages\imapx\2.0.0.18\lib\net452

If the error "cannot be loaded because running scripts is disabled on this system" is obtained when fetching mails through the above PS script, talk to your admin or check Microsoft documentation to allow execution. Read Set Execution Policy .

If the issue is still not resolved, attach the results of execution of above PS script, Mail activity package version and the connection details and create a support ticket with UiPath Product Support.