c# - How to get message body without downloading attachment -
i using imap4 client called: mailkit. works great, have problem on getting body of message without downloading attachments. want show mail's body text , attachments there are, if user clicks on attachment want download attachment. i've tried: var message = inbox.getmessage(uid, cancel.token); but gets entire message. also tried: uids[0] = uid; var ms = inbox.fetch(uids, messagesummaryitems.bodystructure , cancel.token); var bp1 = inbox.getbodypart(uid, ms.first().body, cancel.token); but again downloads attachment. with sample code, downloading entire message because requesting top-level body part of message. mime tree structure of "body parts". want traverse ms.first().body find part(s) want, , download them individually using getbodypart() method. take @ mailkit.bodypartmultipart, mailkit.bodypartmessage, mailkit.bodypartbasic , mailkit.bodyparttext. a bodypartmultipart contains other body parts. a bodypartmessage parts contains me...