Strip attachments from emails using MailKit / MimeKit
问题 I'm using MailKit library to handle emails, which has been working well. However, I'm trying to split emails into their constituent files a) Main email (no attachments) b) Individual attachment files, to store on the filesystem. I can save the attachments individually, but can't seem to remove them from the email body code. I.e. they're getting saved along with the main email, so duplicating data. :/ I've tried: foreach (MimePart part in inMessage.BodyParts) { if (part.IsAttachment) { //