Chapter 8. Connecting to Email Servers (IMAP, POP3, SMTP)

An integration can connect to an IMAP or POP3 email server to retrieve email messages or connect to an SMTP email server to send email messages. To trigger integration execution upon retrieving email, create a connection to an IMAP or POP3 email server and then add that connection as a simple integration’s start connection. To send an email from a flow, create a connection to an SMTP email server and then add that connection to the middle of a flow or to finish a simple integration.

For details, see:

8.1. Creating a connection to an IMAP or POP3 email server

You must create a connection to an IMAP or POP3 email server before you can create a simple integration whose execution is triggered by received email.

Prerequisites

You must be familiar with the email server that this connection accesses. Specifically, you must know:

  • Whether the email server uses the IMAP or POP3 protocol.
  • Whether authentication credentials are required. If they are, you must have a user name and password.
  • Whether a security method is implemented. If one is, you must know which method.
  • Whether a server certificate is required. If it is, you must be able to specify it.

Procedure

  1. In Fuse Online, in the left panel, click Connections to display any available connections.
  2. Click Create Connection to display Fuse Online connectors.
  3. Click the Receive Email connector.
  4. Configure the connection:

    1. In the Protocol field, accept imap or select pop3.
    2. In the Email Host Name field, enter the email server host name, virtual host name, or IP address.
    3. In the Email Server Port Number field, enter the port number that the email server listens on.
    4. In the User Name field, specify the user name for the email account that this connection is authorized to access. During execution of an integration, this connection polls this email account for messages.

      Rarely, an email server does not authenticate access. In that case, specification of user name and password is not required.

    5. In the Password field, specify the password for the email account that this connection is authorized to access.
    6. Optional. In the Security Method field, if the email server implements a security method, select StartTLS or SSL/TLS.
    7. Optional. In the Server Certificate field, if the email server is not public, that is, it is on an internal network, and if you selected StartTLS or SSL/TLS as the security method, paste the self-signed email server certificate in this field. Fuse Online cannot verify this connection if a server certificate is required and you do not specify it.
  5. Click Validate. Fuse Online immediately tries to validate the connection and displays a message that indicates whether or not validation is successful. If validation fails, revise the configuration details as needed and try again.
  6. When validation is successful, click Next.
  7. In the Name field, enter your choice of a name that helps you distinguish this connection from any other connections. For example, enter Obtain Info Emails.
  8. In the Description field, optionally enter any information that is helpful to know about this connection. For example, enter Connect to our company email server to obtain messages sent to info@ourcompany.com.
  9. Click Save to see that the connection you created is now available. If you entered the example name, you would see that Obtain Info Emails appears as a connection that you can choose to add to an integration.

8.2. Creating a connection to an SMTP email server

You must create a connection to an SMTP email server before you can edit an integration flow so that it connects to an SMTP email server to send email.

Prerequisites

You must be familiar with the email server that this connection accesses. Specifically, you must know:

  • Whether authentication credentials are required. If they are, you must have a user name and password.
  • Whether a security method is implemented. If one is, you must know which method.
  • Whether a server certificate is required. If it is, you must be able to specify it.

Procedure

  1. In Fuse Online, in the left panel, click Connections to display any available connections.
  2. Click Create Connection to display Fuse Online connectors.
  3. Click the Send Email connector.
  4. Configure the connection:

    1. In the Email Host Name field, enter the email server host name, virtual host name, or IP address.
    2. In the Email Server Port Number field, enter the port number that the email server listens on.
    3. In the User Name field, specify the user name for the email account that this connection is authorized to access. During execution of an integration, this connection uses this email account to send messages.

      Rarely, an email server does not authenticate access. In that case, specification of user name and password is not required.

    4. In the Password field, specify the password for the email account that this connection is authorized to access.
    5. Optional. In the Security Method field, if the email server implements a security method, select StartTLS or SSL/TLS.
    6. Optional. In the Server Certificate field, if the email server is not public, that is, it is on an internal network, and if you selected StartTLS or SSL/TLS as the security method, paste the self-signed email server certificate in this field. Fuse Online cannot verify this connection if a server certificate is required and you do not specify it.
  5. Click Validate. Fuse Online immediately tries to validate the connection and displays a message that indicates whether or not validation is successful. If validation fails, revise the configuration details as needed and try again.
  6. When validation is successful, click Next.
  7. In the Name field, enter your choice of a name that helps you distinguish this connection from any other connections. For example, enter Send Emails to Leads.
  8. In the Description field, optionally enter any information that is helpful to know about this connection. For example, enter Connect to our company email server to send messages from info@ourcompany.com.
  9. Click Save to see that the connection you created is now available. If you entered the example name, you would see that Send Emails to Leads appears as a connection that you can choose to add to an integration.

8.3. Obtaining email to trigger integration execution

To trigger execution of an integration upon receiving email, add an IMAP or POP3 email server connection as a simple integration’s start connection.

Prerequisites

  • You created an IMAP or POP3 email server connection that is configured to access the account that you want to obtain email from.
  • You know the name of the folder to retrieve messages from.

Procedure

  1. In the Fuse Online panel on the left, click Integrations.
  2. Click Create Integration.
  3. On the Choose a connection page, click the email server connection that you want to use to start the integration.
  4. On the Choose an action page, select Receive Email to periodically retrieve messages from the email account that the connection is authorized to access.
  5. Configure the action:

    1. Leave the Folder field blank to obtain email from the inbox. Or, to obtain messages from a particular folder, enter the name of that folder.

      If this connection accesses a POP3 email server, only standard folders, such as Inbox or Sent are supported.

    2. Select the Unseen Only checkbox to obtain only messages that are marked as unread on the email server.
    3. In the Delay field, accept the default of 5 seconds as the time that elapses between polls for messages. Or, to specify a different polling interval, enter a number and select its time unit.
    4. In the Maximum Emails field, enter the largest number of messages that one poll operation can return. The default is 5. If the inbox or folder contains more than the maximum number of messages that can be returned, the connection returns the oldest messages up to the number set for Maximum Emails.

      Set Maximum Emails to -1 if you want each poll to obtain:

      • All new messages in the specified folder when Unseen Only is selected.
      • All messages in the specified folder when Unseen Only is NOT selected.
  6. Click Next.

Result

The connection appears at the beginning of the integration flow. During execution, if a poll returns email, the connection passes the messages to the next step in the integration. If a poll does not return any email, the integration continues to run but Fuse Online does not trigger the rest of the integration steps.

Example

Consider a Receive Email action that is configured as follows:

  • The Folder field is blank so the connection polls the inbox.
  • Unseen Only is selected.
  • The defaults for Delay (5 seconds) and Maximum Emails (5) are accepted.

Suppose that 10 messages arrive in the inbox during the delay before the next poll. The connection returns the 5 oldest messages. At the next poll, 5 seconds later, the connection returns the other 5 messages. Even if new messages arrived, this is the case because the connection returns the oldest messages if there are more messages than the number set for Maximum Emails.

8.4. Sending email from an integration

In the middle of a flow, or to finish a simple integration, you can add an email server connection that sends messages.

Prerequisites

  • You created an SMTP email server connection that is configured to access the account that you want to send messages from.
  • Fuse Online is prompting you to add to the integration, or to choose the finish connection for a simple integration.

Procedure

  1. On the Add to Integration page, click the plus sign where you want to add the connection. Skip this step if Fuse Online is prompting you to choose the finish connection.
  2. Click the email server connection that you want to use to send messages.
  3. Select the Send Email action.
  4. In the Email from field, enter the email address that sends the messages. This is required even if you plan to add a data mapper step that maps an email address from a previous integration step to this connection.
  5. Recommended: Specify a value in each of the following fields. Separate multiple email addresses with a comma.

    1. Email to
    2. Email subject
    3. Email text
    4. Email cc
    5. Email bcc
  6. In the Parameter Priority field, accept Input Values or select Consumed Data. This determines which of the following has precedence:

    • Input values in this action configuration
    • Data values that you map to this connection

    The recommendation is to select Consumed Data. This means that the values that you specify in the email fields here serve as default values.

  7. Click Next to add the connection to the flow.

Result

The connection appears in the integration flow where you added it.

Next steps

Add all other needed to connections to the flow. Then add a data mapper step before the connection that sends email. In the data mapper step, map source fields to the target fields for sending emails.