+2 votes

I've been moving .eml files from my previous ISP to my new one.

I'm able to upload all my IMAP .eml messages to my new INBOX, but the dates on all those emails are dated the time I uploaded.

Can't seem to figure out how to tell the emails or my new ISP to keep the dates on the original email.


1 Answer

0 votes
Best answer

Most likely the server uses its internal date.

Imap.UploadMessage method has several overloads which take UploadMessageInfo parameter, for example: Imap.UploadMessage(String, UploadMessageInfo)

It has an InternalDate property:

UploadMessageInfo uploadInfo = new UploadMessageInfo();
uploadInfo.Flags = new List<Flag> { Flag.Draft, Flag.Flagged };
    new DateTime(2011, 03, 22, 11, 25, 41, DateTimeKind.Utc));

client.UploadMessage(eml, uploadInfo);

Please use that overload and set this property to IMail.Date.

by (295k points)