Outlook Delete Email
Outlook Delete Email
Section titled “Outlook Delete Email”Type: outlook-delete-email · Package: Outlook Activities v1.0.4
Deletes an email by moving it to Outlook’s Deleted Items folder. Useful for discarding irrelevant or advertising emails within a classification process, while keeping the option to recover them.
How it works
Section titled “How it works”Given the email’s EntryID, it runs Outlook’s standard delete: the email goes to Deleted Items and can be recovered from there until the folder is emptied. If the email was already in Deleted Items, Outlook deletes it permanently.
After deleting it, its EntryID no longer works for the other activities: delete it at the end of the email’s handling.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
entryId | string | — | EntryID of the email (from email.Id). |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanOutlookSession | — | Session from Outlook Connect. Inherited inside the Connect body; without a session the default account is used. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'entryId' is required. | The parameter is missing or the expression returned null. |
| Outlook error when opening the item | The EntryID no longer exists (the email was deleted or moved earlier) or belongs to another profile. Avoid deleting the same email twice and use the .Id from a recent read. |
Example
Section titled “Example”For Each items = emails itemVariable = email └─ activities: If condition = email.Subject.ToLower().Contains("advertising") └─ then: Outlook Delete Email entryId = email.IdRelated activities
Section titled “Related activities”- Outlook Move Email — archive to another folder instead of deleting.
- Outlook Mark Read — mark as read.