Welcome to blogs.conchango.com Sign in | Join | Help

Welcome to blogs.conchango.com

Matt Hall's Blog

Experiences with Microsoft technologies

BizTalk 2006 - SMTP Updates

Here is some information relating to the improvements to the SMTP adapter in BizTalk 2006, as the documentation for it did not make it into beta 1.

Specifying Email Text for Outgoing Email Messages

NOTE: The following settings only apply if the message to be sent is not already MIME encoded. MIME encoded messages are passed through SMTP adapter untouched.

The following configuration properties under SMTP namespace are used to specify the email text for the SMTP messages:

  • EmailBodyText - This property contains the text that will be added to all email messages sent out from the port. The email body part content type will be always set to text/plain.
  • EmailBodyTextCharset - This property contains the encoding to apply to content of EmailBodyText property before sending the email message.
  • EmailBodyFile - This property contains the path to the file that contains the text that will be to all email messages sent out from the port. The file can be either text or html file. (only .txt and .htm extensions are allowed). The email body content type will be set according to file type to either text/plain (for *.txt files) or to text/html (for *.htm files).
  • EmailBodyFileCharset - This property specifies the encoding of the file EmailBodyFile. Note that this property semantic is different from the EmailBodyTextCharset. This property specifies what is the encoding of the file, while EmailBodyTextCharset into which encoding to convert the text.

EmailBodyText property has higher priority over EmailBodyFile property. The corresponding properties are available at the SMTP send port property page UI.

SMTP adapter performs the following when it gets a message from engine for sending:

If a message is already MIME encoded/encrypted/signed then the adapter just sends it out over SMTP protocol. The EmailBody* settings are not applied to the message. Otherwise adapter creates a MIME message with first part built from the EmailBody* settings.

ReplyBy message header

NOTE: The following settings only apply if the message to be sent is not already MIME encoded. MIME encoded messages are passed through SMTP adapter untouched.

The message context property ReplyBy under SMTP namespace is used to set the date and time for the Follow up header of the outgoing email.

When this property is set then the SSA adds the following headers to the outgoing email:

X-Message-Flag:    Follow-up
Reply-By:          <ReplyBy>

The format of the reply by header is defined as per RFC 822. The date time information will be represented in a local time with time offset. It will not be localized.

Example:
X-Message-Flag:    Follow-up
Reply-By:          Fri, 4 Feb 2005 08:30:00 -0800

Attaching BizTalk message parts

SMTP adapter provides a configuration option to specify how BizTalk message parts should be attached to outgoing email message. The property is defined in SMTP namespace and is called MessagePartsAttachments. The property has 3 possible values:

0 (same as not set) - Do not attach any biztalk message parts. This is a default setting.

1 - Attach only biztalk body part

2 - Attach all parts

The corresponding setting is available in SMTP send port property page UI

Attaching files

The Attachments configuration property under SMTP namespace is used to specify the list of file paths that point to files that need to be attached to email message sent over the SMTP send port. The list of paths is "pipe" ("|") separated. The corresponding setting is available in SMTP send port property page UI.

The SMTP adapter performs the following when it gets a message from EPM for sending:

If a message is already MIME encoded/encrypted/signed then the adapter just sends it out over SMTP protocol. The Attachments setting is not applied to the message. Otherwise the adapter adds the files specified in Attachments property as additional MIME parts of outgoing email message. Attachment parts are appended to the parts generated from BizTalk message parts.

Handling MIME specific context and part properties

The SMTP adapter uses MIME specific part context property "FileName" to construct attachment headers of outgoing SMTP message. If this property is set on the part context then adapter will add the following header to the attachment part:

Content-Disposition: attachment;
filename="<FileName>"

Determining the content type of attachment

The content-type for each attachment will be determined from the file extension based on the information contained in the registry of the machine where SMTP adapter runs.

Note: the information about extension - content type mapping can be found in HKEY_CLASSES_ROOT.

If there is no mapping found the attachment will have content type set to application/octet-stream.

Published 09 August 2005 09:19 by Matthew.Hall
Filed under:

Comments

No Comments
New Comments to this post are disabled
Powered by Community Server (Personal Edition), by Telligent Systems