# Read email

Node type `browser_getEmail`

## What it does

Retrieve email using the configured mailbox settings.

## Desktop client configuration

![Read email configuration in the desktop client](/assets/get-email.f52d720148cf439f5e0dcbec30bab39988e3463e9882146c25511ce7a4679026.0538f3a9.webp)

Captured in the English interface of MoreLogin Desktop V2.73.101.

## Inputs

These fields belong in `data.browserUi.inputs`.

| Field | Type or values | Schema required | Execution default | Description and bounds |
|  --- | --- | --- | --- | --- |
| `user` | `string` | No | — | Email account |
| `authType` | `"password"` / `"oauth2"` (supports variable references) | No | `"password"` | Authorization Method. Editor initial value `"password"` |
| `password` | `string` | No | — | Password / authorization code |
| `imapHost` | `string` | No | — | IMAP server |
| `port` | `WorkflowNumber` | No | `993` | Port; integer 1–65535 after resolution. Editor initial value `993` |
| `tls` | `boolean` (supports variable references) | No | `true` | Enable TLS. Editor initial value `true` |
| `clientId` | `string` | No | — | Client ID |
| `clientSecret` | `string` | No | — | Client Secret |
| `refreshToken` | `string` | No | — | Refresh Token |
| `status` | `"UNSEEN"` / `"SEEN"` / `"ALL"` (supports variable references) | No | `"UNSEEN"` | Email status. Editor initial value `"UNSEEN"` |
| `isJunk` | `boolean` (supports variable references) | No | `false` | Also search spam. Editor initial value `false` |
| `seen` | `boolean` (supports variable references) | No | `false` | Mark as read after retrieval. Editor initial value `false` |
| `from` | `string` | No | — | Sender filter |
| `mailTo` | `string` | No | — | Recipient filter |
| `subject` | `string` | No | — | Subject contains |
| `keyword` | `string` | No | — | Body keyword |
| `dateType` | `"all"` / `"today"` / `"recent"` (supports variable references) | No | `"all"` | Email date. Editor initial value `"all"` |
| `reg` | `string` | No | — | Extraction regex |


## Mode requirements and limits

- Required `user`, `imapHost`, `port`
- imapHost is a host name; port is an integer in 1–65535.
- Validation code `RPA_NODE_INPUT_INVALID`


**`authType` `eq` `"password"`**

- Required `password`
- The value is a password or a mailbox authorization code.
- Validation code `RPA_NODE_INPUT_INVALID`


**`authType` `eq` `"oauth2"`**

- Required `clientId`, `refreshToken`
- This mode supports only Outlook/Hotmail IMAP. A Microsoft refresh_token is exchanged for an access_token, and the rotated refresh_token is cached locally in encrypted form. clientSecret is optional (public client apps do not need it).
- Validation code `RPA_NODE_INPUT_INVALID`
- The node makes a real IMAP connection and reads the newest email that matches the filters. password mode uses a password or authorization code and works with any IMAP host. OAuth2 and "Also search spam" are supported only for Outlook/Hotmail (outlook.office365.com, imap-mail.outlook.com); other hosts return MAIL_PROVIDER_UNSUPPORTED. imapHost takes only the host name, without a port or path. The last three days are today and the two days before it, in the executing machine's local time. When reg is set, the first capture group or the full match is returned. If the newest email does not match, null is returned, with no fallback to older emails. When reg is not set, extractedValue is the body. seen=true marks only the selected email as read. message.receivedAt is the time the email was received (desktop client local time, YYYY-MM-DD HH:mm:ss). More than 10000 candidates in one folder returns MAIL_SEARCH_LIMIT, a single email over 10 MiB returns MAIL_MESSAGE_LIMIT, and a connection/authentication failure returns MAIL_CONNECTION_FAILED (the server's original text and credentials are not exposed). POP3, sending email, and attachment download are not supported.
- Validation code `RPA_NODE_INPUT_INVALID`


## Input references

| Field | Allowed forms |
|  --- | --- |
| `user` | `literal`, `template` |
| `authType` | `literal`, `template` |
| `password` | `literal`, `template` |
| `imapHost` | `literal`, `template` |
| `port` | `literal`, `template` |
| `tls` | `literal`, `template` |
| `clientId` | `literal`, `template` |
| `clientSecret` | `literal`, `template` |
| `refreshToken` | `literal`, `template` |
| `status` | `literal`, `template` |
| `isJunk` | `literal`, `template` |
| `seen` | `literal`, `template` |
| `from` | `literal`, `template` |
| `mailTo` | `literal`, `template` |
| `subject` | `literal`, `template` |
| `keyword` | `literal`, `template` |
| `dateType` | `literal`, `template` |
| `reg` | `literal`, `template` |


## Outputs

| Output field | Type or values |
|  --- | --- |
| `found` | `boolean` |
| `message` | `object` / `null` |
| `extractedValue` | `string` / `null` |


Reference published fields as `${nodeId.data.field}`.

## JSON example

A complete node object for a workflow's `nodes` array or another node's `blocks`. `mailPassword` is a private initial parameter declared in `workflow.variables`.

```json
{
  "id": "read_code_email",
  "type": "browser_getEmail",
  "data": {
    "title": "Read the verification email",
    "browserAction": "getEmail",
    "browserUi": {
      "inputs": {
        "user": "user@example.com",
        "authType": "password",
        "password": "${mailPassword}",
        "imapHost": "imap.example.com",
        "port": 993,
        "tls": true,
        "status": "UNSEEN",
        "from": "no-reply@example.com",
        "dateType": "today",
        "reg": "\\b(\\d{6})\\b"
      },
      "exception": {
        "timeout": 30000,
        "policy": "interrupt"
      }
    }
  }
}
```

[Back to the node catalog](/browser-rpa/nodes)