Quantcast
Channel: Aspose.Email Product Family
Viewing all articles
Browse latest Browse all 1367

create .msg file - cant set date

$
0
0
Hi,

I am migrating emails stored in various formats (.htm, rtf, .txt) from a legacy document management system, so I am reconstituting them into .msg files. The emails are not stored on an exchange server, only in the legacy system. The emails will be loaded directly into Sharepoint, so not going into exchange at all.

When I try the following trivial test, the Date field (i.e. sent date) is not being set, so when I open the .msg file (with an outlook client) there is no sent date information. Also pressing ALT-ENTER to show the properties of the email shows no sent date.

Can anyone please help?

MailMessage mailMsg = new MailMessage();
mailMsg.From = "FromMe@demo.com";
mailMsg.To = "ToYou@demo.com";
mailMsg.Subject = "my subject";
mailMsg.TextBody = "my body";
mailMsg.Date = DateTime.Today;

MapiMessage outlookMsg = MapiMessage.FromMailMessage(mailMsg);
outlookMsg.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNMODIFIED);

string strMsgFile = @"E:\tmp\sample.msg";
outlookMsg.Save(strMsgFile);

Thanks.



Viewing all articles
Browse latest Browse all 1367

Trending Articles