Skip to main content

Overall Behavior

Overall Behavior

First, it is useful to understand the details that you specify for the adapter. The EnsLib.EMail.InboundAdapterOpens in a new tab class provides runtime settings that you use to specify items like the following:

  • The POP3 server to use and login details for the mailbox from which to read messages

  • Matching criteria that indicate the messages of interest

  • A polling interval, which controls how frequently the adapter checks for new input

In general, the inbound email adapter (EnsLib.EMail.InboundAdapterOpens in a new tab) periodically checks the mailbox, finds matches, sends the messages (as instances of %Net.MailMessageOpens in a new tab) to the associated business service, and deletes the messages from the email server. The business service, which you create and configure, uses these messages and communicates with the rest of the production. The following figure shows the overall flow:

Diagram showing an email message on a POP3 server flowing through an email inbound adapter and business service

More specifically:

  1. The adapter regularly executes its OnTask() method, which connects to the POP3 server and logs on, using a specific username and password. The polling interval is determined by the CallInterval setting.

  2. The adapter looks at all the messages in this mailbox and compares them against the match criteria.

  3. When the adapter finds a message that meets the criteria, it does the following:

    1. The adapter creates an instance of the %Net.MailMessageOpens in a new tab class and puts the email data into it.

    2. The adapter calls the internal ProcessInput() method of the associated business service class, passing the %Net.MailMessageOpens in a new tab instance as input.

    3. The adapter deletes the mail message from the server.

  4. The internal ProcessInput() method of the business service class executes. This method performs basic production tasks such as maintaining internal information as needed by all business services. You do not customize or override this method, which your business service class inherits.

  5. The ProcessInput() method then calls your custom OnProcessInput() method, passing the %Net.MailMessageOpens in a new tab instance as input. The requirements for this method are described later in Implementing the OnProcessInput() Method.

The response message follows the same path, in reverse.

FeedbackOpens in a new tab