Pretty sure the BCC field never gets sent along with the message.
The BCC field is used to send "Blind Carbon Copies" to recipients. From WikiPedia:
In the context of correspondence, blind carbon copy (abbreviated Bcc:) allows the sender of a message to conceal the person entered in the Bcc: field from the other recipients.
If the recipients in the BCC field were actually contained in the raw SMTP text of the email, then this guarantee could not be enforced.
The method you linked to in your question is more than likely used by SmtpClient
to prepare the message for transmission. As such, it would have to ignore the BCC field in order to maintain the expected behavior.
To actually keep it in, you would have to manually insert it into the output text:
var email = new MailMessage();
using (var reader = new StreamReader(email.RawMessage()))
using (var writer = new StringWriter()) {
while(true) {
var line = reader.ReadLine();
if (line == null) break; // EOF
if (line != "") {
// Header line
writer.WriteLine(line);
continue;
}
// End of headers, insert bcc, read body, then bail
writer.WriteLine("Bcc: " + email.Bcc.ToString()); // or however you want to format it
writer.WriteLine("");
writer.Write(reader.ReadToEnd());
break;
}
var messageText = writer.ToString();
// Do something with message text which now has Bcc: header
}