Transport providers

By default, Altairis Mail Toolkit uses the default .NET configuration to send e-mail messages, either using SMTP over network or Mail Pickup Folder of MS SMTP Server (part of Windows operating system). It has however extensible architecture, which allows any other means to be plugged instead of the default configuration.

Currently it provides its own "SmtpShovel" technology, intended for use by Azure Web Sites, but it's possible to write providers for 3rd party services, such as Postmark, SendGrid or Amazon SMS.

Provider configuration

This is example configuration of transport provider:
<altairis.mailToolkit>
  <templateResource type="SampleLocalPickup.Resources.MailerTemplates, SampleLocalPickup"/>
  <from address="from@example.org"/>
  <transport defaultProvider="LocalFolderProvider">
    <providers>
      <add name="LocalFolderProvider" type="Altairis.MailToolkit.Transport.SmtpClientTransportProvider, Altairis.MailToolkit"
            customPickupDirectory="~/App_Data/MailQueue"
            handlerEnabled="true" 
            handlerIpAddresses="127.0.0.1,::1" 
            handlerTimeWindow="10" 
            handlerSecret="nlu7zNdrTi1IRLFyMNU2WK1hBbv1/uuKxNhjBAe65J0=" />
    </providers>
  </transport>
</altairis.mailToolkit>

<transport> element

Has single mandatory attribute defaultProvider, which specifies name of the transport provider to be used by default.
It contains one or more providers/add elements, configuring the provider to use. Each <add> element defines and configures single transport provider and has name (logical name) and type (provider class type name) as mandatory attributes. Each transport provider can define any number of other configuration attribues.

Configuring SmtpClientTransportProvider

SmtpClientTransportProvider is part of Altairis Mail Toolkit core library and allows separate configuration of the default .NET SmtpClient class for use by the toolkit. It has also some additional features for use with SmtpShovel.

The configuration attributes of add elements are:
Name Description
name Logical provider name.
type Must be Altairis.MailToolkit.Transport.SmtpClientTransportProvider, Altairis.MailToolkit
customPickupDirectory (optional) If set, the provider uses the Mail Pickup Folder functionality and will save the outgoing message files to specified folder. Unlike the standard .NET configuration, the path can be specified as relative to your web application root, which can be used for SmtpShovel.
handlerEnabled (optional) When set to true, the SmtpShovel mail pickup handler is enabled.
handlerIpAddresses (optional, valid only when handlerEnabled=true) Comma separated list of IP addresses (IPv4 or IPv6) from where access to the pickup handler is enabled.
handlerTimeWindow (optional, valid only when handlerEnabled=true) The handler request contains signature with embedded timestamp. This attribute sets the maximum time skew between the client and server in seconds. Default value is 30 seconds.
{{handlerSecret (optional, required when handlerEnabled=true) Secret used for signing handler request. May be any valid Base64 encoded value, 512-bit random value is recommended.

Last edited Jun 3, 2013 at 2:11 PM by altair, version 2

Comments

No comments yet.