PDA

View Full Version : Recreate email from database record



Bsbosa.com
07-09-2010, 01:20 PM
I am writing an application to migrate records from a DocuShare document management system to a TRIM Records management system.
Moving documents (anything that is not an email) is straight forward, but for some reason DocuShare takes any email that is lodged and ripps it up into component pieces and stores these in a database table.
I can find the To, From, Subject, Body, Header and other data and now my challenge is to reconstitute the original email so I can move it into TRIM.

I have tried using the Office.Interop.Outlook class to create an email, but I can't include the Header or the From Information.
I.E.
Outlook.MailItem mailItem = new Microsoft.Office.Interop.Outlook.MailItem();
mailItem.Body = "This is My Test";
mailItem.Subject = "Test Message";
mailItem.Attachments.Add("C:\\AttachmentDocument.txt", Outlook.OlAttachmentType.olByValue, 1, "AttachmentDocument.txt");
mailItem.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFo rmatHTML;
mailItem.To = "ToPerson@theirEmail.Address.com";
mailItem.BCC = "";
mailItem.CC = "";
mailItem.SaveAs("Path", Outlook.OlSaveAsType.olMSG);


Does anyone know of an other way to recreate these emails so that I can include the header and from (and maybe other) fields?