Skip to content

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.

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.

ParameterTypeDefaultDescription
entryIdstring—EntryID of the email (from email.Id).
ParameterTypeDefaultDescription
sessionZoanOutlookSession—Session from Outlook Connect. Inherited inside the Connect body; without a session the default account is used.

This activity does not return a value.

MessageCause and fix
'entryId' is required.The parameter is missing or the expression returned null.
Outlook error when opening the itemThe 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.
For Each items = emails itemVariable = email
└─ activities:
If condition = email.Subject.ToLower().Contains("advertising")
└─ then:
Outlook Delete Email entryId = email.Id