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.
Tres protocolos, tres usos
Section titled “Tres protocolos, tres usos”| Protocolo | for what | Activities |
|---|---|---|
| SMTP | Send email | SMTP Send |
| IMAP | Read and manage mail (folders, read/unread, move, delete) — recommended | IMAP Read, IMAP Save Attachment, IMAP Mark Read, IMAP Move, IMAP Delete |
| POP3 | Read basic (no folders or state) — only if no IMAP | POP3 Read, POP3 Delete |
Connection to the server
Section titled “Connection to the server”Since these activities do not maintain a session, each receives connection data from the server. They are the same in all:
| Parameter | Description |
|---|---|
host | Servidor (e.g. smtp.gmail.com, imap.gmail.com, pop.gmail.com) |
port | Puerto. Por defecto: SMTP 587, IMAP 993, POP3 995 |
username | Username (usually your full email address) |
password | Password — uses a credential, see below |
security | Encryption: auto · none · ssl · starttls. By default the appropriate one for each protocol |
Servidores comunes
Section titled “Servidores comunes”| Proveedor | SMTP (enviar) | IMAP (read) |
|---|---|---|
| Gmail | smtp.gmail.com : 587 | imap.gmail.com : 993 |
| Outlook.com / M365 | smtp.office365.com : 587 | outlook.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.
Reading flow: mailId
Section titled “Reading flow: mailId”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.IdThe properties of each email (
.Subject,.From,.Body,.Attachments…) are in Data types › ZoanMail.
Activities
Section titled “Activities”Enviar (SMTP)
Section titled “Enviar (SMTP)”| Activity | Type | Output | What it does |
|---|---|---|---|
| SMTP Send | smtp-send | — | Send an email |
Read and manage (IMAP)
Section titled “Read and manage (IMAP)”| Activity | Type | Output | What it does |
|---|---|---|---|
| IMAP Read | imap-read | List | Read emails with filters |
| IMAP Save Attachment | imap-save-attachment | — | Save email attachments |
| IMAP Mark Read | imap-mark-read | — | Mark an email as read |
| IMAP Move | imap-move | — | Move an email to another folder |
| IMAP Delete | imap-delete | — | Delete an email |
Read basic (POP3)
Section titled “Read basic (POP3)”| Activity | Type | Output | What it does |
|---|---|---|---|
| POP3 Read | pop3-read | List | Read emails (without folders or filters) |
| POP3 Delete | pop3-delete | — | Delete an email |
Next steps
Section titled “Next steps”- SMTP Send — send emails.
- IMAP Read — read the filter tray.
- Credential Usage — save the password securely.