Hello,
actually I have tested your code, sent the message and after I received it from the server, the BCC headers in the attached eml actually stayed there...
Try my code:
// get mail with BCC from the server
MailMessage original = imap.GetMailMessage(sequenceNumber);
// see whether it contains the BCC header
if (original.Bcc.Count == 0)
Console.WriteLine("No BCC found in original email.");
else
Console.WriteLine("BCC header = '{0}'", original.Bcc);
// new message
MailMessage forward = new MailMessage();
// initialize it
forward.To = "mary@example.org";
forward.From = "peter@example.org";
forward.Subject = "FW: " + original.Subject;
forward.BodyText = "Hello, I am forwarding this to you!";
// add the original e-mail as an attachment
forward.Attachments.Add(new Attachment(original));
// send message
Smtp smtp = new Smtp();
smtp.Connect("SMTP-server");
smtp.Login("user", "password");
smtp.LogWriter = new Rebex.FileLogWriter(@"C:\temp\log.txt", LogLevel.Verbose);
smtp.Send(forward, "from@domain.com", "to@domain.com");
smtp.Disconnect();
If you do not get the BCC header in the attached email, just look into the verbose log and see whether the BCC header was there when sending by Rebex Smtp.