Created
September 30, 2019 07:31
-
-
Save GroupDocsGists/1b36d099e167b1936cf41d387a3906e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string outputDirectory = @"C:\output"; | |
using (Viewer viewer = new Viewer("with_attachments.msg")) | |
{ | |
IList<Attachment> attachments = viewer.GetAttachments(); | |
foreach(Attachment attachment in attachments) | |
{ | |
string filePath = Path.Combine(outputDirectory, attachment.FileName); | |
viewer.SaveAttachment(attachment.Id, File.OpenWrite(filePath)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment