mail egress connector

Mail Egress Connector

Version: 17.07

Supported Since: 17.01

What is Mail Egress Connector?

The Mail Egress Connector can be used to send emails using UltraESB-X via a mail server.

In order to use the Mail Egress Connector, you must first select the Mail Connector dependency from the connector list when you are creating an empty Ultra project. If you have already created a project, you can add the Mail Connector dependency via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list, select the Mail Connector dependency.
mail egress connector 1

Out Ports

Response Processor

The message will be sent to this out port if the Complete Flow property is disabled and the message has been sent to the email address successfully

On Exception

The message will be sent to this out port if the Egress Connector failed to process the message due to some reason

Side Ports

Connector Operation

This port is used to connect operational elements to the Egress Connector. By default, user does not have to connect any operational element and the default connector operation will be used.


* marked fields are mandatory

Protocol *


Protocol to be used for accessing the mail server. SMTP (smtp) is recommended.

Host *


Hostname (or IP address) of the mail server

Port *


Service port on the mail server (usually dependent on the protocol)

User *


Username for authenticating to the mail server

Password *


Password for authenticating to the mail server

Other Settings


Map of additional transport-level properties for mail server access, such as standard JavaMail properties (e.g. enabling SSL as in the above example)



Weight for the Egress Connector if this Egress Connector is under a weighted Egress Load Balancer

Complete Flow


If true, the integration flow will be completed once the message has been sent to the email address. If false, the original message sent to the email address will be emitted to the Response Processor out port to continue the flow



From address for the outbound email



Reply-To address to be included in the outbound email



A comma-separated list of To addresses for the outbound email



A comma-separated list of CC addresses for the outbound email



A comma-separated list of BCC addresses for the outbound email



Subject of the outbound email



Priority of the outbound email (may be email provider specific)

Sample Use case

A minimal configuration for the Mail Egress Connector consists of the following:

  • Protocol

  • Host

  • Port

  • User

  • Password

In addition, at least one of the To, CC or BCC fields may need to be specified as the email recipient. If none is specified, the destination address of the message will be used as the To address of the outbound email. Some mail server implementations may also require a suitable From address for the outbound email.

If the mail service is accessible only over SSL (as is the case with mail providers like Gmail or Yahoo), an Other Settings Map containing mail.<protocol>.starttls.enable set to true will also have to be specified. The Other Settings Map can also be useful for specifying other custom transport-related parameters, such as standard JavaMail parameters.

In order to trigger the mail sending flow, let’s start with a Timer Ingress Connector as the ingress connector for the flow (which will generate only a single "tick", Polling Repeat Count having been set to 0, hence sending out only one test email):

timer sceduling
Figure 1. Timer Ingress Connector Configuration

Since the inbound message from the Timer Task Listener has no payload, let’s add a String Payload Setter to populate the message with a test payload string (which will be made available as the body of the email):

payload setter basic
Figure 2. String payload Setter Configuration

If the payload is of text/html content type, a multipart email would be generated appropriately, but otherwise a plaintext email would be generated with the raw message payload as the email body.

If attachments are available in the UltraESB-X message received by the Mail Egress Connector, they would be attached to the outbound email. Add a File Attacher element to attach a file from a known location to the message:

file attacher basic
Figure 3. File Attacher Configuration

Also, create a file /tmp/test.txt with some sample text, to be picked by the File Attacher.

Finally, let’s add a Mail Egress Connector for sending out the enriched message as an email, with the following configurations: