Skip to content

SMTP / IMAP / POP3 Email Activities

Version: 1.0.0  ·  ID: zoan-packages-smtp  ·  Author: Zoan Software

This package works with email by connecting directly to a server, without depending on an installed client. Works with any standard server: Gmail, Outlook.com / Microsoft 365, or your company’s corporate server.

Protocolofor whatActivities
SMTPSend emailSMTP Send
IMAPRead and manage mail (folders, read/unread, move, delete) — recommendedIMAP Read, IMAP Save Attachment, IMAP Mark Read, IMAP Move, IMAP Delete
POP3Read basic (no folders or state) — only if no IMAPPOP3 Read, POP3 Delete

Since these activities do not maintain a session, each receives connection data from the server. They are the same in all:

ParameterDescription
hostServidor (e.g. smtp.gmail.com, imap.gmail.com, pop.gmail.com)
portPuerto. Por defecto: SMTP 587, IMAP 993, POP3 995
usernameUsername (usually your full email address)
passwordPassword — uses a credential, see below
securityEncryption: auto · none · ssl · starttls. By default the appropriate one for each protocol
ProveedorSMTP (enviar)IMAP (read)
Gmailsmtp.gmail.com : 587imap.gmail.com : 993
Outlook.com / M365smtp.office365.com : 587outlook.office365.com : 993

Security: save the password in a credential

Section titled “Security: save the password in a credential”

The password field is of type credential. Never write the password in plain text: save it to a Zoan Cloud credential and use it with = credential("correo-bot").ToPlainText(). This way it is not exposed in the playbook or in the logs.

Just like in Outlook, IMAP Read (and POP3 Read) return a mail list (ZoanMail). Each email has an identifier, its .Id (UID in IMAP, index in POP3), which you pass as mailId to other activities to indicate which email to act on (save attachments, mark, move, delete).

IMAP Read host = "imap.gmail.com" username = = credential("bot")["user"] password = = credential("bot").ToPlainText()
unreadOnly = true → output: correos
For Each items = = correos itemVariable = correo
└─ activities:
IMAP Save Attachment ... mailId = = correo.Id outputPath = "C:/adjuntos"
IMAP Mark Read ... mailId = = correo.Id

The properties of each email (.Subject, .From, .Body, .Attachments…) are in Data types › ZoanMail.

ActivityTypeOutputWhat it does
SMTP Sendsmtp-sendSend an email
ActivityTypeOutputWhat it does
IMAP Readimap-readListRead emails with filters
IMAP Save Attachmentimap-save-attachmentSave email attachments
IMAP Mark Readimap-mark-readMark an email as read
IMAP Moveimap-moveMove an email to another folder
IMAP Deleteimap-deleteDelete an email
ActivityTypeOutputWhat it does
POP3 Readpop3-readListRead emails (without folders or filters)
POP3 Deletepop3-deleteDelete an email