Get email messages

  • Due to a recent upgrade in Microsoft, multi-factor authentication (MFA) is now activated by default. To configure Microsoft 365 authentication in Azure with MFA deactivated, see Azure Configuration for Modern Authentication.
  • Known Issue: When using the Get email messages DAC configured with POP3 on a mailbox, emails are incorrectly marked as Read instead of remaining Unread. This behavior is due to a limitation of the POP3 protocol. Currently, there is no workaround available. Monitor email statuses manually or consider using IMAP configuration if possible.

Use this to command to identify all email messages matching a specified filter or a single message matching a key for the purpose of performing a sequence of actions on the message(s).

Step 1: Identify the messages

The first step in using the Get Email Messages command is to identify the messages on which the specified actions will be performed.

Email account tab

The settings available on the Email account tab vary for Exchange and IMAP/POP3 servers.

Get messages tab

  1. (a) Define the filter by which the messages will be identified and retrieved; or

    (b) Enter the name of the variable into which you have set an email key. (For more information, see Get Email Trigger Input.)

    To define search From, enter the email address (for example, gilgolan@yahoo.com). To define search To, enter the display name only. (for example, if the complete email is Mike Smith <mikesmith@yahoo.com>, enter Mike Smith)

  2. Enter the name of the variable into which you'd like to place the result (the number of messages matching the filter criteria).

  3. Indicate if you would like to retry the search until at least one message is found and, if applicable, specify retry settings.

  4. Instruct the wizard how to handle any errors encountered. Read more about error handling.

Step 2 - Define the actions

After identifying the messages from the previous step, you can then define how you want to process them.

Upon adding the Get email messages command to your wizard, you will notice that it becomes an empty "container" within the Editor Pane, waiting for you to fill it with instructions:

Enter the action(s) the wizard should take on each matching email message. You can do this by dragging the required Advanced Command(s) directly into the container.

Loop-the-loop

The wizard performs the actions defined within the container by looping through each retrieved message (i.e., it will perform the complete sequence of actions on a single message, then move on to perform the sequence on each remaining message in turn).

No limits

You can use any available Advanced Command within the Get Email Messages container (i.e., don't feel limited to using just the Email commands!)

Break that loop!

Under certain conditions, you may want to break and/or restart the loop created by the Get Email Messages container. This can be done by using the Loop: Break and/or the Loop: Restart command (usually within an If Else command).

Using Credentials by variable functionality

The Credential by Variable functionality allows you to create a dynamic connection to the credentials vault. The credential variable is associated with credential display name(s).

Since the credential variables are dynamic, if you export a wizard to another environment, make sure that the credentials associated with the variable are defined in the new environment's credential vault.