views:

169

answers:

1

When looking at http://msdn.microsoft.com/en-us/library/aa560648%28BTS.10%29.aspx I couldn't find BCC or Priority, so I'm sure it's not supported.

But why ?

+1  A: 

For the why of BCC and Priority missing from the SMTP Adapter, no idea I'm afraid - it has been missing from BizTalk since the first release of the product. You'd probably have to ask the BizTalk product team and I imagine they would just shrug.

There are however, a couple of work-arounds to add in the BCC and priority.

The first work around is an out and out hack, but fast to implement - send two emails, with the second being your BCC list that mentions that it is a BCC. Ugly and sure to come back and bite you. (this only works for the priority)

The second way is more correct but also more work - create your own SMTP adapter that supports these properties. The System.Net.Mail namespace contains all you will need to roll your own adapter that supports BCC.

The code example below comes from MSDN:

MailAddress from = new MailAddress("[email protected]", "Ben Miller");
MailAddress to = new MailAddress("[email protected]", "Jane Clayton");
MailMessage message = new MailMessage(from, to);
message.Subject = "Using the SmtpClient class.";
message.Body = @"The body test to send.";
message.Priority = MailPriority.High;

MailAddress bcc = new MailAddress("[email protected]");
message.Bcc.Add(bcc);

SmtpClient client = new SmtpClient(server);
client.Send(message);

You could even avoid the overhead of an adapter and implement this as a referenced assembly - the downside of doing it that way is that when using an adapter you automatically get plugged into the BizTalk messaging framework and its features such as tracking.

David Hall