BizTalk 2004 - sending messages using SMTP

The SMTP adapter can be used to send messages to email addresses.

By default, the SMTP adapter comes with few options:

  • Note that BizTalk is no mail server. The SMTP adapter can connect to a mail server. So, to be able to send the mail out, you need a mail server as well.
  • You can control the “subject“, “from” and “to“ fields of the mail in a static way by defining them in the send port.
  • With the “from“-field contents, your mails server might have problems. Most mail servers do not accept mail relaying, which is sending mail on behalf of an address / domain that is not related to the mail server.
  • Multiple email-addresses are possible in a single field. You should be using a separator that is recognized by the mail server forwarding your mail. Usually a comma or a semicolon are separators.
  • Remember always to use a send pipeline that includes an smtp-encoder in the port definition. When you leave out the smtp-encoder, the message will be sent as plain text in the body of the email message.
  • Using the smtp-encoder, only a single message attachment can be linked to the email. You can not really control the name, extension, mime type of the attached message.

For the advanced applications:

  • Multiple attachments are possible. This is a so-called multipart message consisting of a body and more than one attachments. You will have to populate the whole multipart message in the BizTalk orchestration. The smtp-adapter then transforms that into a real email message, exactly following the multipart-layout you defined.
  • Many of the parameters of the email can be set dynamically in an orchestration. Please have a look at various weblog-posts on the net.
This article is part of the GWB Archives. Original Author: Erwin Homan

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.