Listing Emails From a Server
  • 20 May 2022
  • 1 Minute to read
  • Dark
    Light

Listing Emails From a Server

  • Dark
    Light

Overview

Using the Get Email step alongside the Get Headers step, a Flow can retrieve messages from a mail server. Messages can be displayed as a list on a Form or used in other ways and be retrieved from either an IMAP or POP server.


Using Gmail with Email steps
With Google depreciating Less Secure App settings for Google accounts, users will need to create App Passwords in order to utilize Email steps with Gmail.



Example

The following example will retrieve a specific message from a Gmail account and display the list in a Form using IMAP. This example can also work for a POP mail server, replacing the IMAP steps with its POP equivalent.

  1. In a Designer Folder, create a new Flow.
  2. In the Toolbox, expand Communication > Email > IMAP and select the Get Headers step, and add it to the workspace.  
  3. On the Properties tab for the Get Headers step, enter "10" for the Count field, the appropriate Username, and Password, enter "993" for Port, enter "imap.gmail.com" for Server, and select the checkbox for Secure Connection.
     
  4. In the Toolbox, navigate to Communication > Email > IMAP.  and add the Get Email step to the workspace.
  5. On the Properties tab for the Get Email step, map the same Gmail Server credentials to the inputs. For Unique Id, map Headers.All UniqueId.First.

    The Get Email step uses a Unique Id to retrieve the full message from an Email. This field works on the assumption that previous steps may output more than one Message Header to get a certain message category.
  6. On the Found path. add a Show Form step. Connect the Not Found path to the End step.
  7. Select the Show Form step and create a new Form.
  8. Configure the Form with a Text Box Multi Line and Button control. Click Save and close the Form Designer.
  9. With the Show Form step selected, on the Properties panel click Unknown and select Select From Flow. Select Message as the input
     

Debug

  1. Click Debug from the top action bar. Click START DEBUGGING. A Form displays the details of a single Message downloaded from the Gmail Account.




For further information on Flows, visit the Decisions Forum.



Was this article helpful?