SMTP Adapter
Overview
The SMTP adapter will allow Neuron to send email messages from Neuron using an SMTP server. The adapter provides several options for creating the email message. The body of the ESB Message can either be set as the body of the email or as an attachment to the email. See the property description below for more information.
Requirements
This adapter requires an SMTP Server for sending messages.
Adapter Modes
The adapter supports the following mode of operation.
Mode | Description |
Subscribe | Send a message from Neuron as an email. |
Design-Time Properties
Property Name | Description |
Addressing | |
Bcc | The default Bcc address to use when sending emails. Multiple addresses can be entered, separated by a semicolon (;). You can also dynamically select the addresses from the ESB Message by entering an XPATH expression (MUST begin with a ‘/’), or by entering the name of a context property. If entering a context property, the context property MUST be preceded by ‘Property:’ and be in the format of ‘prefix.propertyName’. For example: ‘Property:Order.Bcc. This property is optional. |
CC | The default CC address to use when sending emails. Multiple addresses can be entered, separated by a semicolon (;). You can also dynamically select the addresses from the ESB Message by entering an XPATH expression (MUST begin with a ‘/’), or by entering the name of a context property. If entering a context property, the context property MUST be preceded by ‘Property:’ and be in the format of ‘prefix.propertyName’. For example: ‘Property:Order.CC. This property is optional. |
From | The default From address to use when sending emails. The value is used by receiving email servers for sending Read and Delivery receipts to. Only one address can be entered. You can also dynamically select the address from the ESB Message by entering an XPATH expression (MUST begin with a ‘/’), or by entering the name of a context property. If entering a context property, the context property MUST be preceded by ‘Property:’ and be in the format of ‘prefix.propertyName’. For example: ‘Property:Order.From. This property is required. |
To | The default To address to use when sending emails. Multiple addresses can be entered, separated by a semicolon (;). You can also dynamically select the addresses from the ESB Message by entering an XPATH expression (MUST begin with a ‘/’), or by entering the name of a context property. If entering a context property, the context property MUST be preceded by ‘Property:’ and be in the format of ‘prefix.propertyName’. For example: ‘Property:Order.To’. This property is required. |
Message | |
Attachments | Enter a full path and file name to instruct the adapter to attach the file to the email message. Multiple files may be entered by separating each with a semicolon (;). This property is optional. |
Body Format | Specifies whether the body of the message is HTML. Default is False. This property is ignored if the property ‘Message as Attachment’ is set to True. |
Filename | When either the ‘Xpath as Attachment’ property is set or the ‘Message as Attachment’ property is set to True, this is the filename given to the attachment. You can also dynamically select the filename from the ESB Message by entering an XPATH expression (MUST begin with a ‘/’), or by entering the name of a context property. If entering a context property, the context property MUST be preceded by ‘Property:’ and be in the format of ‘prefix.propertyName’. For example: ‘Property:Order.Filename’. This property is required. |
Message as Attachment | When set to True, the ESB Message body will be sent as an attachment to the email. Otherwise the ESB Message body will be used as the body of the email. |
Processing Instructions | These processing instructions are appended to the message. This usually applies to messages based on InfoPath. This property is optional. |
Subject | The default value to use as the Subject of the email. You can also dynamically select the subject from the ESB Message by entering an XPATH expression (MUST begin with a ‘/’), or by entering the name of a context property. If entering a context property, the context property MUST be preceded by ‘Property:’ and be in the format of ‘prefix.propertyName’. For example: ‘Property:Order.Subject. This property is required. |
Xpath as Attachment | Enter a valid XPATH statement (MUST begin with ‘/’) that will be used to retrieve the section of the ESB Message body to send as an attachment. This property is optional. |
Xsl Template | If the property ‘Message as Attachment’ is set to False, the XSL Template will be used to transform the message before it is set as the email body. The XSL Templates are stored in the Neuron data repository. The property is optional. |
Notification | |
Delayed Delivery | Sends a Delayed Delivery Notification Receipt to the From address. This property is optional. |
Failed Delivery | Sends a Failed Delivery Notification Receipt to the From address. This property is optional. |
Read Notification | Sends a Read Receipt to the From address. This property is optional. |
Successful Delivery | Sends a Delivery Receipt to the From address. This property is optional. |
Server | |
SMTP Port | The SMTP Server port number. The default value is 25. |
SMTP Server | The SMTP Server name or IP address. The default is localhost. |
Run-Time Properties
Outbound Properties
The following message properties will be used at runtime if the Include metadata property is checked on the adapter endpoint:
When the Neuron adapter endpoint has the include metadata option set, then the adapter will use the following properties in the ESBMessage received from Neuron instead of the properties set in the adapter endpoint UI. The adapter metadata must be specified in the custom properties of the message header.
The names of the properties are case sensitive.
All of the adapter metadata properties are optional even when the include metadata option is set. For more details about each of these properties, reference them from the table above.
Property Name | Description |
General Properties | |
smtp.From | From address |
smtp.To | To address(es) |
smtp.Cc | Cc address(es) |
smtp.Bcc | Bcc address(es) |
smtp.Subject | Subject line text |
smtp.ReadReceipt | Read receipt requested |
smtp.DeliveryReceipt | Delivery receipt requested |
smtp.DelayReceipt | Delay receipt requested |
smtp.FailureReceipt | Failed delivery receipt requested |
smtp.ContentTransferEncoding | Content Transfer Encoding used for sending message |
smtp.Body | Email body (if not specified then the ESB Message body is used) |
smtp.Server | The SMTP Server name or IP address |
smtp.Port | The SMTP Server port |
smtp.Attachment | If not blank, then the specified file name is attached to the email message. Multiple messages may be attached. |
smtp.IsBodyHtml | Whether the body format of the email is HTML |
smtp.BodyAsAttachment | Send the ESB Message body as an email attachment |
smtp.ProcessingInstructions | Processing Instructions to append to message |
smtp.XpathAsAttachmentIsBinary | Flag indicating whether the XPATH attachment is a binary object |
smtp.FileName | The filename to use if the ESB Message body is send as an attachment |
To set these properties at run-time, create a new Process, include a Code step, and use code similar to this:
context.Data.SetProperty("smtp", "Subject", "Neuron Email");
Subscribe Mode
The SMTP adapter receives a message from the ESB and sends it as an email, as directed by the properties defined above. When no runtime message properties are provided, the adapter will use all of the properties set at design time using the adapter endpoint UI. Any runtime properties that are set would be used instead of the values provided at design time. For example, it’s common to set the “From” property at design time, because you may want all emails sent by Neuron to be from the same sender. However, the list of recipients and the subject of the message may change based on a process flow or the type of message being processed, so you set the smtp.To and smtp.Subject properties in a code step at runtime.