Scenario: I use SmtpClient to send message (previously received from Exchange Online) to the smart host. According to RFC I need to add Received header, so that it appears before all other headers.
I use Add method, because there are no Insert method:
ms.Headers.Add(“Received”, “value”);
Issue: My Received header appears after other Received headers. Is their API to add first header.
To see it in action:
var m0 = MailMessage.Load(“dsample.eml”,
new EmlLoadOptions { PreserveTnefAttachments = true });
m0.Headers.Add(“Received”, “Value”);
m0.Save(“sample-resaved.eml”);
Thanks,
Alex Shloma