IMAP Read
IMAP Read
Section titled “IMAP Read”Type: imap-read · Package: SMTP / IMAP Email Activities v1.0.0 · Output: List
Reads mail from an IMAP server and returns a list of messages (ZoanMail). It is the starting point of the processes that react to incoming mail, with powerful filters to bring only what interests you. It is the recommended option for reading mail (more complete than POP3).
How it works
Section titled “How it works”It connects to the IMAP server, opens the indicated folder (by default INBOX) and returns up to limit emails that meet the filters. By default it brings only unread ones (unreadOnly = true). Each mail has .Id (its UID), .Subject, .From, .Body, .Attachments — see ZoanMail.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
host | text | Servidor IMAP (e.g. imap.gmail.com). |
username | text | User. |
password | credencial | Password or App Password. Use = credential(...). |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
port | number | Puerto IMAP. Por defecto 993. |
folder | text | Folder. By default INBOX. |
unreadOnly | boolean | Only unread. By default true. |
subject | text | Filter: Subject contains this text. |
from | text | Filter: The sender contains this text. |
since | text | Filter: received since this date (YYYY-MM-DD). |
before | text | Filtro: recibidos antes de esta fecha (YYYY-MM-DD). |
hasAttachments | boolean | Filter: only emails with attachments. |
includeAttachments | boolean | Download the content of the attachments in .Attachments. By default false. |
limit | number | Maximum number of emails to return. By default 10. |
security | list | Cifrado: auto · none · ssl (def.) · starttls. |
Output
Section titled “Output”Returns a List of emails (ZoanMail). Go through it with For Each.
Example
Section titled “Example”Read unread emails with “Order” in the subject and process them:
IMAP Read host = "imap.gmail.com" username = = credential("bot")["user"] password = = credential("bot").ToPlainText() unreadOnly = true subject = "Pedido" hasAttachments = true → output: correos
For Each items = = correos itemVariable = correo └─ activities: IMAP Save Attachment host = "imap.gmail.com" username = = credential("bot")["user"] password = = credential("bot").ToPlainText() mailId = = correo.Id outputPath = "C:/pedidos" IMAP Mark Read host = "imap.gmail.com" username = = credential("bot")["user"] password = = credential("bot").ToPlainText() mailId = = correo.IdRelated activities
Section titled “Related activities”- IMAP Save Attachment — guardar adjuntos.
- IMAP Mark Read / IMAP Move — manage read emails.
- Data types › ZoanMail — properties of each mail.