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" <[email protected]>
X-Receiver: [email protected]
X-Receiver: [email protected]
X-Receiver: [email protected]
MIME-Version: 1.0
From: "Joe" <[email protected]>
To: [email protected]
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.