SMTP Delivery Protocol
The Simple Mail Transfer Protocol (SMTP) delivery protocol creates and routes notification messages for delivery by Microsoft Exchange or other SMTP mail systems.
Defining a Delivery Channel Using the SMTP Delivery Protocol
Define the delivery channel in the /DeliveryChannels/DeliveryChannel section of the configuration file. The following list reviews the elements in this section and provides the values required by the SMTP delivery protocol:
- <DeliveryChannelName> (required)
- This value can be any string that conforms to XML naming conventions. It must be unique within your application.
- <ProtocolName> (required)
- This value must be SMTP.
- <Arguments> and child elements
- The SMTP delivery protocol takes two named arguments as initialization parameters.
SMTP Delivery Protocol Configuration File Definition
<DeliveryChannels>
<DeliveryChannel>
<DeliveryChannelName>SMTPServer1</DeliveryChannelName>
<!-- "SMTP" is a well-known protocol name. It does not
require a corresponding entry in the Protocols section
of the configuration file. -->
<ProtocolName>SMTP</ProtocolName>
<Arguments>
<Argument>
<Name>SmtpServer</Name>
<Value>MJOLLNIR</Value>
</Argument>
<Argument>
<Name>BodyEncoding</Name>
<Value>utf-16</Value>
</Argument>
</Arguments>
</DeliveryChannel>
</DeliveryChannels>
Defining SMTP Delivery Protocol Information in the ADF
Define the notification-specific SMTP delivery protocol information in the /NotificationClasses/NotificationClass/Protocols/Protocol section of the application definition file (ADF). The following list reviews the elements in this section and provides their required values:
- <ProtocolName> (required)
- This value must be SMTP.
- <Fields> and child elements
- The SMTP delivery protocol allows five fields to be specified for use in the header of the notification message, in the order presented. If you use a string constant as a <SqlExpression> value in any of these fields, it must be enclosed in apostrophes (expressed as the entity reference ' in the ADF).
- Subject (required) specifies the expression that represents the subject line to be displayed in the e-mail.
- From (required) specifies the sending e-mail address to be displayed in the e-mail.
- To (required) must specify the address of the target device for standard notifications. This field must be blank for a notification class that is providing multicast notifications.
- Priority (optional) specifies the priority with which the notification e-mail is to be sent, using the values appropriate for the mail subsystem that will be delivering the message. For example, with Microsoft Exchange you would specify Low, Normal, or High. The notification priority default is Normal if no other value is specified.
- BodyFormat (optional) takes either Text or Html as its value, depending on what the intended format is for the notification data provided by the content formatter. The notification format default is Text if no value is specified.
SMTP Delivery Protocol ADF Definition
<Protocols>
<Protocol>
<ProtocolName>SMTP</ProtocolName>
<Fields>
<Field>
<FieldName>Subject</FieldName>
<SqlExpression>
'The price of ' + StockSymbol
+ ' is now ' + StockPrice
</SqlExpression>
</Field>
<Field>
<FieldName>From</FieldName>
<SqlExpression>
'stockquotes@microsoft.com'
</SqlExpression>
</Field>
<Field>
<FieldName>To</FieldName>
<SqlExpression>DeviceAddress</SqlExpression>
</Field>
<Field>
<FieldName>Priority</FieldName>
<SqlExpression>'Normal'</SqlExpression>
</Field>
<Field>
<FieldName>BodyFormat</FieldName>
<SqlExpression>'html'</SqlExpression>
</Field>
</Fields>
<ProtocolExecutionSettings>
...
</ProtocolExecutionSettings>
</Protocol>
</Protocols>