Skip to content

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.

ModeDescription
SubscribeSend a message from Neuron as an email.

Design-Time Properties

Property NameDescription
Addressing 
BccThe 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.
CCThe 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.
FromThe 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.
ToThe 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 
AttachmentsEnter 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 FormatSpecifies 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.
FilenameWhen 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 AttachmentWhen 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 InstructionsThese processing instructions are appended to the message.  This usually applies to messages based on InfoPath.  This property is optional.
SubjectThe 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 AttachmentEnter 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 TemplateIf 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 DeliverySends a Delayed Delivery Notification Receipt to the From address.  This property is optional.
Failed DeliverySends a Failed Delivery Notification Receipt to the From address.  This property is optional.
Read NotificationSends a Read Receipt to the From address.  This property is optional.
Successful DeliverySends a Delivery Receipt to the From address.  This property is optional.
Server 
SMTP PortThe SMTP Server port number.  The default value is 25.
SMTP ServerThe 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 NameDescription
General Properties 
smtp.FromFrom address
smtp.ToTo address(es)
smtp.CcCc address(es)
smtp.BccBcc address(es)
smtp.SubjectSubject line text
smtp.ReadReceiptRead receipt requested
smtp.DeliveryReceiptDelivery receipt requested
smtp.DelayReceiptDelay receipt requested
smtp.FailureReceiptFailed delivery receipt requested
smtp.ContentTransferEncodingContent Transfer Encoding used for sending message
smtp.BodyEmail body (if not specified then the ESB Message body is used)
smtp.ServerThe SMTP Server name or IP address
smtp.PortThe SMTP Server port
smtp.AttachmentIf not blank, then the specified file name is attached to the email message.  Multiple messages may be attached.
smtp.IsBodyHtmlWhether the body format of the email is HTML
smtp.BodyAsAttachmentSend the ESB Message body as an email attachment
smtp.ProcessingInstructionsProcessing Instructions to append to message
smtp.XpathAsAttachmentIsBinaryFlag indicating whether the XPATH attachment is a binary object
smtp.FileNameThe 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.

Was this article helpful?
Dislike 0
Previous: SQL Adapter
Next: SharePoint 2010 Publication Adapter