Email IMAP/OAuth2
Retrieve the content of sent emails from Gmail, Yahoo, Hotmail, etc.
Email Service
Select the email service from which to retrieve email content:
- Gmail: Read email content from Gmail.
- Outlook/Hotmail: Read email content from Hotmail/Outlook.
- Yahoo: Read email content from Yahoo.
- Custom: Read email content from a custom service.
Advanced Configuration
- IMAP Server: The IMAP server is pre-configured (except for custom email services).
- Connection Port: Port for connecting to services other than the default ones.
- Secure TLS Connection: Ensures secure communication.
Email
Enter the email address of the account from which to read content.
Password
Enter the password for the account from which to read content.
ClientId
A unique identifier for the application registered with Microsoft Azure App Registration. It informs Microsoft which application is requesting access to user data (in this case, Hotmail/Outlook emails).
RefreshToken
A refresh_token
is used to renew an access_token
(a short-lived access token). The access_token
typically lasts for 1 hour, after which the refresh_token
is needed to obtain a new access_token
without requiring the user to log in again.
Advanced filters
- Folder: Retrieve email content from specific mailbox folders (e.g., INBOX or JUNK).
- Read Emails from (n Minutes) Ago: Read content from emails sent within the specified time frame from the present.
- From includes: Enter the sender’s email address for the emails to read.
- To includes: Enter the recipient’s email address for the emails to read.
- Subject includes: Enter the subject of the emails to read.
- Body includes: Enter any content within the emails to read.
Regex extract data
Extract content based on the specified regex. If left blank, all text in the email is retrieved.
- Match All (g): Retrieve all text matching the selector.
- Ignore Case (i): Retrieve text matching the selector, case-insensitive.
- Multiline (m): Select matching text across multiple lines.
Timeout
Maximum time to wait for finding and reading email content.
Mark as Read
After reading, the email is marked as read.
Assign to Variable
Assign the text to a Variable.
- Variable Name: Specify the variable name to assign the text to. This field is optional when
Assign to Variable
is selected.
Insert into Table
Assign the text to a column in a Table.
- Select Column: The column where the text will be inserted. This field is optional when
Insert into Table
is selected.
Practical Examples
Reading Gmail Emails
Example
I want to use the Email IMAP/OAuth2
node to read emails from the following Gmail account, then extract the number string contained in the message
I configure the node as follows:
Since I want to read emails from Gmail
, I select the Gmail
service and enter the account email in the Email
field. For the Password
field, instead of the account password, I use an app password
for the account.
To create an app password
, I visit https://myaccount.google.com/apppasswords
, enter an App Name
, and click Create
as shown below. After creation, I enter the generated value into the Password
field.
Next, I open Advanced filters
and select the mailbox to read from. Here, I want to read from the INBOX
, so I enter INBOX
. I select Only Read Unread Emails
to read the latest emails. For Read Emails from (n Minutes) Ago
, I set it to 10 minutes. To ensure I read emails from a specific sender, I enter their address in Select only unread emails
. I configure the regex as \d+
to extract only numbers from the email. After retrieving the text, I assign it to a variable named mail
for later use. The node configuration looks like this:
When running the node, I successfully retrieve the desired text
Reading Outlook Emails
Example
I want to use the Email IMAP/OAuth2
node to read emails from the following Outlook account:
I configure the node as follows:
Since I want to read emails from Outlook
, I select the Outlook/Hotmail
service and enter the account email in the Email
field. Then, I enter the clientId
in the ClientId
field and the refreshToken
in the RefreshToken
field.
Next, I open Advanced Email Filtering
and select the mailbox to read from. Here, I want to read from the INBOX
, so I enter INBOX
. I select Only Read Unread Emails
to read the latest emails. For Read Emails Within (x Minutes) Ago
, I set it to 50,000 minutes since the latest email is from April 13. I configure the regex as \d+
to extract only numbers from the email. After retrieving the text, I assign it to a variable named mail
for later use. The node configuration looks like this:
When running the node, I successfully retrieve the desired text: