serag
serag

Reputation: 11

how can i connect to imap gmail or outlook.office365.com using G1ant robot RPA

Can someone help with the below issue:

I'm using the latest version of G1ANT robotic software. I've been able to successfully connect to outlook using the office addon however now I need to access emails on gmail and office 365. As a first step i'm trying to connect to gmail with the below code but I keep getting timeout error. I followed the exact steps in their tutorial but it does not work. Can someone please help:

addon net version 4.101.0.0
addon core version 4.101.0.0
addon language version 4.103.0.0

♥yesterday = ⟦date:dd.MM.yyyy⟧02.10.2019
mail.imap imap.gmail.com login [email protected] password myPasssword sincedate ♥yesterday todate ♥date onlyunreadmessages true ignorecertificateerrors true result ♥list 

foreach ♥element in ♥list
  dialog ♥element
end

Upvotes: 0

Views: 121

Answers (1)

Wiktoria Prusik
Wiktoria Prusik

Reputation: 838

G1ANT doesn't support mail.imap command anymore but you can increase the timeout for this command by adding the timeout argument and some value (number of milliseconds).

Here's a quote from the manual.

The timeout argument allows to choose the amount of time (in milliseconds) for the robot to wait for a command to be executed before throwing an error about time expiration.

In your example it will look like below. I increased the timeout, so that it will wait for 100000 milliseconds the longest.

mail.imap imap.gmail.com login [email protected] password myPasssword sincedate ♥yesterday todate ♥date onlyunreadmessages true ignorecertificateerrors true result ♥list timeout 100000 

Also, please be aware that mail.imap command has some issues, for example in order for it to work correctly, it is needed to have for example the errorcall argument specified because it almost always throws exception. The problem is explained better on another StackOverflow question.

So I advise you to use this instead:

imap.open imap.gmail.com login ♥login password ♥password ignorecertificateerrors true
imap.getmails result ♥list 
imap.close

foreach ♥element in ♥list
  dialog ♥element
end

Upvotes: 1

Related Questions