Skip to content

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).

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.

ParameterEditorDescription
hosttextServidor IMAP (e.g. imap.gmail.com).
usernametextUser.
passwordcredencialPassword or App Password. Use = credential(...).
ParameterEditorDescription
portnumberPuerto IMAP. Por defecto 993.
foldertextFolder. By default INBOX.
unreadOnlybooleanOnly unread. By default true.
subjecttextFilter: Subject contains this text.
fromtextFilter: The sender contains this text.
sincetextFilter: received since this date (YYYY-MM-DD).
beforetextFiltro: recibidos antes de esta fecha (YYYY-MM-DD).
hasAttachmentsbooleanFilter: only emails with attachments.
includeAttachmentsbooleanDownload the content of the attachments in .Attachments. By default false.
limitnumberMaximum number of emails to return. By default 10.
securitylistCifrado: auto · none · ssl (def.) · starttls.

Returns a List of emails (ZoanMail). Go through it with For Each.

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.Id