Use the EmailOutput node to send email messages to one or more recipients.
This topic contains the following sections:
The EmailOutput node delivers an email message from a message flow to an SMTP server that you specify.
You can configure the EmailOutput node by using the node properties in the IBM® Integration Toolkit, or dynamically from the local environment and email output header (EmailOutputHeader) that are associated with the message (for more information, see Producing dynamic email messages). You can configure the EmailOutput node to produce an e-mail with a single attachment. When you produce email messages dynamically, you can specify multiple attachments.
The EmailOutput node is contained in the Email drawer of the message flow node palette, and is represented in the IBM Integration Toolkit by the following icon:
You can view information about samples only when you use the product documentation that is integrated with the IBM Integration Toolkit or the online product documentation. You can run samples only when you use the product documentation that is integrated with the IBM Integration Toolkit.
When you have put an instance of the EmailOutput node into a message flow, you can configure it. For more information, see Configuring a message flow node. The properties of the node are displayed in the Properties view.
All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk.
Location | Description |
---|---|
Root.EmailOutputHeader.To | A comma separated list of email addresses. |
Root.EmailOutputHeader.Cc | A comma separated list of email addresses. |
Root.EmailOutputHeader.Bcc | A comma separated list of email addresses. |
Root.EmailOutputHeader.From | A comma separated list of email addresses. |
Root.EmailOutputHeader.Reply-To | A comma separated list of email addresses. |
Root.EmailOutputHeader.Subject | The subject of the email. |
Local environment | Description |
---|---|
Destination.Email.SMTPServer | The Server:Port of the SMTP server. Port is optional; if you do not specify it, the default value is 25. |
Destination.Email.SecurityIdentity | The security identity for authentication with the SMTP server, which can be the name of the userid and password pair that is defined using the mqsisetdbparms command, or it can reference an external resource that has a securityIdentity attribute that references a userid and password that are defined using the mqsisetdbparms command. In both cases, the value is appended after the string “smtp::”. For example, if you use the mqsisetdbparms command to create a userid and password of smtp::myUseridPassword, the securityIdentity that is specified on the node, or indirectly in an external resource, is myUseridPassword. |
Destination.Email.BodyContentType | Identifies that the body of the email message
contains HTML rather than plain text. You can set this property to
text/plain, text/html, or text/xml; text/plain is the default value. To set the content type for the body of the message, use
the following notation.
To additionally set the character set (charset)
in which the message body is sent, use the following notation.
This example sends a text/HTML email with a charset of
UTF-8. |
Destination.Email.MultiPartContentType | The type of multipart, including related, mixed, and alternative. You can set any value here. |
Destination.Email.Attachment.Content | Either the attachment (BLOB/text), or an XPath
or ESQL expression that references an element; for example, an element
in the message tree or local environment. The value of the referenced
element is taken as the content of the attachment.
|
Destination.Email.Attachment.ContentType | The type of attachment (also known as Internet Media Type), including text/plain, text/html, and text/xml. You can set any value here. |
Destination.Email.Attachment.ContentName | The name of the attachment. |
Destination.Email.Attachment.ContentEncoding | The encoding of the attachment: 7bit, base64,
or quoted-printable.
|
mqsicreateconfigurableservice MY_BROKER –c SMTP –o SMTP_MyAlias
followed
by: mqsichangeproperties MY_BROKER –c SMTP –o SMTP_MyAlias –n serverName –v smtp.hursley.ibm.com:25
These
commands override the SMTP server and port values that are specified
on any nodes that also specify an alias of SMTP_MyAlias. If the local
environment contains any overrides, they take preference over the
broker external resource properties. See also the following example: mqsichangeproperties MY_BROKER –c SMTP –o SMTP_MyAlias –n securityIdentity –v mySecurityIdentity
You
must also use the mqsisetdbparms command
to define the security identity at the broker run time.Connect the In terminal to the node from which outbound messages bound are routed.
Connect the Out or Failure terminal of this node to another node in this message flow to process the message further, process errors, or send the message to an additional destination.
Location | Description |
---|---|
WrittenDestination.Email.smtpServer | The Server:Port of the SMTP server. |
WrittenDestination.Email.messageId | The ID of the email sent message. |
These values are written in WrittenDestination within the local environment tree structure.
If you do not connect either terminal, the local environment tree is unchanged.
The EmailOutput node terminals are described in the following table.
Terminal | Description |
---|---|
In | The input terminal that accepts a message for processing by the node. |
Failure | The output terminal to which the message is routed if a failure is detected when a message is propagated. Connect the Failure terminal of this node to another node in the message flow to process errors. |
Out | The output terminal to which the message is routed if it has been propagated successfully. Connect the Out terminal of this node to another node in the message flow to process the message further or send the message to an additional destination. |
The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the BAR file at deployment).
The EmailOutput node Description properties are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Node name | No | No | The node type, EmailOutput | The name of the node. |
Short Description | No | No | A brief description of the node. | |
Long Description | No | No | Text that describes the purpose of the node in the message flow. |
Use the EmailOutput node Basic properties are described in the following table.
Property | M | C | Default | Description | mqsiapplybaroverride command property |
---|---|---|---|---|---|
SMTP Server and Port | No | Yes | This property defines the SMTP server and port
to which emails are sent from this node, and is in the format server:port;
for example: my.smtp.server:25. The port value
is optional, but if you do not specify a port value, the default value
is 25. You can specify an alias value for this property. If the alias exists at run time, the specified values are used. If the alias does not exist at run time, the broker assumes the value to be a valid SMTP host. |
smtpServer |
The EmailOutput node Email properties are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
To Addresses | No | No | The main recipient or recipients of the email. This property can include a single email address or a comma-separated list of email addresses. | |
Cc Addresses | No | No | The carbon copy recipient or recipients of the email. This property can include a single email address or a comma-separated list of email addresses. | |
Bcc Addresses | No | No | The blind carbon copy recipient or recipients of the email. This property can include a single email address or a comma-separated list of email addresses. | |
From Address | No | No | The email address of the sender of the email. | |
Reply-To Address | No | No | The email address to which recipients of the email reply. | |
Subject of email | No | No | The subject of the email. | |
Email message text | No | No | The main text of the email. Use this
property to provide a static main body of an email. If you use this property, it overrides the content that is provided in the body of the message tree that is passed to the input node. If you do not specify a value for this property, the text of the email is the body of the message tree that is passed to the EmailOutput node. |
|
Body Content Type | No | No | text/plain | You can use this property to force the content
type for the body of the email message. Valid values are:
|
The EmailOutput node Security properties are described in the following table.
Property | M | C | Default | Description | mqsiapplybaroverride command property |
---|---|---|---|---|---|
Security Identity | No | Yes | A security identifier to retrieve a user ID and password that are configured at the broker run time. | securityIdentity |
The EmailOutput node Attachment properties are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Attachment Content | No | No | An XPath or ESQL expression that references an element; for example, an element in the message tree, or local environment. The content of the attachment is the value of the element that is referenced. | |
Attachment Content Name | No | No | The name of the attachment that is seen by the recipient of the email. This property is optional. If you do not specify a name, a default name is assigned. | |
Attachment Content Type | No | No | text/plain | The type of the attachment. This property is
optional, even if you have specified an attachment. Valid values are:
|
Attachment Content Encoding | No | No | 7bit | The encoding of the attachment. This property
is optional. If you do not specify a value, a default encoding is
assigned. Valid values are:
|
Multipart Content Type | No | No | Mixed | The type of multipart. Valid values are:
|
The Validation properties of the EmailOutput node are described in the following table.
See Validation properties for a full description of these properties.
Property | M | C | Default | Description | mqsiapplybaroverride command property |
---|---|---|---|---|---|
Validate | Yes | Yes | Inherit | This property controls whether validation takes place. Valid values are None, Content and Value, Content, and Inherit. | validateMaster |
Failure action | Yes | No | Exception | This property controls what happens if validation fails. You can set this property only if you set Validate to Content or Content and Value. Valid values are User Trace, Local Error Log, Exception, and Exception List. |
Property | M | C | Default | Description |
---|---|---|---|---|
Events | No | No | None | Events that you have defined for the node are
displayed on this tab. By default, no monitoring events are defined
on any node in a message flow. Use Add, Edit,
and Delete to create, change or delete monitoring
events for the node; see Configuring monitoring event sources using monitoring properties for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box. |