Get Email
  • 09 Mar 2025
  • 4 Minutes to read
  • Dark
    Light

Get Email

  • Dark
    Light

Article summary

Step Details
Introduced in Version---
Last Modified in Version8.17.0
LocationCommunication > Email

The retrieval of messages from a mail server in a Flow becomes possible through the combined use of the Get Email step and the Get Headers step. These messages can be conveniently displayed as a list on a Form or utilized for various purposes. The retrieval process is supported for both IMAP and POP servers, offering versatility in accessing email data within the Flow.


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.



Properties

Gmail

PropertyDescriptionData Type
Use Recent FlagUsing pop with Gmail will not retrieve all messages. Using the recent flag will get Gmail to return messages from the last 30 days.
Note: The "Use Recent Flag" setting must be used on BOTH the "Get Email" step and the "Get Headers" step to return the most recent emails; if Use Recent Flag is enabled on the "Get Header" step but not enabled on the "Get Email" step, then it will return no emails found.
Boolean

Output Settings

PropertyDescriptionData Type
Mail Type OutputThis property allows the user to download the email as either an MSG (.msg) or MIME (.eml) type file.Email

Inputs

PropertyDescriptionData Type
FolderName of the Folder the emails are located in. (Inbox, Spam, Trash, etc.)String
Inline Images as AttachmentsAdds images that are inline in an email as an attachment.Boolean
OAuth TokenAllows a user to specify the IMAP or POP3 email server token. (Requires: email account configured for OAuth and POP3 or IMAP; OAuth Provider and Token for POP3 or IMAP).String
PasswordThe password of the user connecting to the email server.String
PortPort number of the email server.Int32
Secure ConnectionUsed if the email server credentials require a secure connection (must be true when using OAuth for POP3 or IMAP).Boolean
ServerIMAP or POP email server.String
Unique IDThe Get Email step uses a Unique ID to retrieve the full message from an Email. This field assumes that previous steps may output more than one Message Header to get a certain message category.String
Use OAuthSpecifies the use of OAuth authentication.Boolean
UsernameUsername to connect to the email server.String

Outputs

PropertyDescriptionData Type
FoundEmail MessageEmail


Error connecting to IMAP server 'number' by port 'number'. SSL = False

The exception message indicates that there is an issue connecting to the IMAP/POP server with the given configuration. To resolve this, follow these steps:

  • Double-check Server and Port Settings
  • Enable SSL (Secure Socket Layer)
  • Check Network and Firewall Settings
  • Verify Credentials

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get Email 1[GetEmail] in flow [Display Steps]: Error connecting to imap server '123' by port '143'. SSL = False
 ---> DecisionsFramework.LoggedException: Error connecting to imap server '123' by port '143'. SSL = False
 ---> System.ArgumentException: Hostname is invalid. (Parameter 'serverName'
 at Rebex.Net.Imap.lcdhv(String p0, Int32 p1, TlsParameters p2, SslMode p3
 at Rebex.Net.Imap.Connect(String serverName, Int32 serverPort
 at DecisionsFramework.ServiceLayer.Services.Email.ImapPop3Utility.OpenImapConnection(ConnectionData conn)
   --- End of inner exception stack trace --- at DecisionsFramework.ServiceLayer.Services.Email.ImapPop3Utility.OpenImapConnection(ConnectionData conn
 at DecisionsFramework.Design.Flow.CoreSteps.EMail.Imap.BaseImapStep.Run(StepStartData data
 at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData
 at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)
   --- End of inner exception stack trace ---

Example Use Case

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.


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.



Step Changes

DescriptionVersionRelease DateDeveloper Task
Added a new property on the Get Email step for POP and IMAP. This property allows the user to download the email as either an MSG (.msg) or MIME (.eml) type file.8.13August 2023[DT-037903]
Added new property "Use Recent Flag" for the Get Email Step.8.17December 2023[DT-038377]

Related Information

Forum Posts:
How To Have Get Emails Step Filter Specific Folder


Was this article helpful?