Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.