Hello, I would like to create Outlook.MailItem (I believe) from an existing one on disk. I have a path stored in a string and I would like to access it and save it.
I can't figure out how to open it in C # and access it.
I currently have something like
where fl evaluates to something like "C: \ users \ msgs \ email.msg"
Thanks for the time
Outlook.Application app = new Outlook.Application(); try { foreach (String fl in Directory.GetFiles(docInfo.LocalPath + _preprocessorDirectory)) { if (Regex.IsMatch(fl.Trim(), _regex, RegexOptions.IgnoreCase)) { Outlook.MailItem email = new Outlook.MailItem(fl); SaveAttachments(email); SaveBody(email); } } } catch (Exception ex) { logger.Error("Error in Process for document " + docInfo.OriginalPath, ex); callback.Invoke(docInfo, false); } return false;
source share