为什么 BizTalk 2009 SMTP 适配器不支持 BCC 和优先级?

发布于 2024-08-14 00:08:26 字数 215 浏览 4 评论 0原文

查看 http://msdn.microsoft.com/ 时en-us/library/aa560648(BTS.10).aspx 我找不到密件抄送或优先级,因此我确信它不受支持。

但为什么 ?

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

But why ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

分开我的手 2024-08-21 00:08:27

对于为什么 SMTP 适配器中缺少 BCC 和优先级,我恐怕不知道 - 自该产品的第一个版本以来,BizTalk 中就一直缺少它。您可能需要询问 BizTalk 产品团队,我想他们只会耸耸肩。

然而,有一些解决方法可以在 BCC 和优先级中添加。

第一个解决方案是彻头彻尾的黑客攻击,但实施起来很快 - 发送两封电子邮件,第二封是您的密件抄送列表,其中提到它是密件抄送。丑陋,肯定会回来咬你。 (这仅适用于优先级)

第二种方法更正确,但也需要更多工作 - 创建您自己的支持这些属性的 SMTP 适配器。 System.Net.Mail 命名空间包含您推出支持 BCC 的适配器所需的所有内容。

下面的代码示例来自 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);

您甚至可以避免适配器的开销并将其实现为引用的程序集 - 这样做的缺点是,当使用适配器时,您会自动插入 BizTalk 消息传递框架及其功能(例如跟踪)。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文