Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. string outputDirectory = @"C:\output";
  2. using (Viewer viewer = new Viewer("with_attachments.msg"))
  3. {
  4. IList<Attachment> attachments = viewer.GetAttachments();
  5. foreach(Attachment attachment in attachments)
  6. {
  7. string filePath = Path.Combine(outputDirectory, attachment.FileName);
  8. viewer.SaveAttachment(attachment.Id, File.OpenWrite(filePath));
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement