Using the MailMessage object we were adding a custom header with the .Add_(“X-Custom”, “MyValue”)
We were saving this message to the drafts folder via AppendMessage.
Upon sending this email from Outlook or OWA,. the Sent Items folder contained the custom header in the mail options. However when the mail was received, the custom header was missing. This result happened no matter which user we logged into the EWS service with. It did however work for one user in particular (which we weren’t able to track why, perhaps a permissions issue).
We were using impersonation as well to save the draft in other user’s draft folders. But when we saw this issue we took this out of the equation in the event this was causing the issue. Removing impersonation however did not change the outcome, the headers were still stripped.
We then decided to use the EWS Managed API by Microsoft to achieve our goal. We added the custom header and saved the draft (through regular and impersonation) and after sending the draft from the client, the mail message contained the custom headers in the inbox of the recipient.
Is Aspose Email using the EWS Managed API under the hood at all? The only other big difference in code I noticed was that we are doing an auto discover on the service uri after providing the credentials, where in Aspose Email we have to specify the uri. Using EWS however, I specified the same uri we were passing to Aspose and the headers still came through appropriately.
Aspose.Email for .NET 4.0
Thank you in advance and please let me know if you need any additional information.