BCC never sent from Exchange 2007 using SpecifiedPickupDirectory

我怕爱的太早我们不能终老 提交于 2019-12-24 12:11:27

问题


I'm using an Exchange 2007 pickup directory to send emails from my ASP.NET application with System.Net.Mail.SmtpClient. Thus I'm using SmtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory. It sends emails fine, but then I noticed that BCC is not working at all. The file being placed in the pickup folder seems to have the right settings, but Exchange is ignoring the X-Receiver list. Here is a sample of the EML file being created:

X-Sender: "Joe" <joe@example.com>
X-Receiver: david@example.com
X-Receiver: contact@example.com
X-Receiver: lindsey@example.com
MIME-Version: 1.0
From: "Joe" <joe@example.com>
To: david@example.com
Date: 10 Mar 2009 9:32:27 -0500
Subject: Test Message
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

<p>Test Message</p>

contact@ and lindsey@ are the BCC recipients. When I use a network send, it works fine. BCC only stops working with the pickup directory. So you know, I'm using Windows Server 2008 and ASP.NET 3.5 / C#.

Workaround

It seems that Exchange 2007 ignores the X-Receiver and expects to see Bcc: instead. So I've resorted to doing mailMessage.Headers.Add("Bcc", bccList) where bccList is a semicolon-delimited list of the email addresses. That works fine.

But as pointed Chase Seibert out if you look at the header of the message in the email client, you can still see all the X-Receivers listed. Though Bcc is stripped out and thus hidden from the recipients. So you get the effect of a Bcc with the possibility that someone will open the message and see all the Bcc's. I think the best way to suppress the X-Receivers list is to not include anything in the mailMessage.Bcc property.


回答1:


This definitely works in Windows 2003 Server w/ just the MS SMTP implementation that ships with the OS. My understanding is that Exchange uses the same service to do it's sending.

Though this may not answer your question, I wanted to note that the Pickup method has a drawback that you might not be aware of. Typically, MS SMTP strips BCC and X-Recipient headers from the EML during the inbound transport.

When you put the EML into Pickup, you skip this step. Thus, remote recipients will actually be able to SEE the BCC recipients if they look at the email header. Try sending an email to a gmail account and BCC someone else. If you view the header in Gmail, you will see the BCC recipient.

I would recommend using SMTP to hand-off this message instead.



来源:https://stackoverflow.com/questions/631799/bcc-never-sent-from-exchange-2007-using-specifiedpickupdirectory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!