c# - How to check if message has attachments (MailKit) -
I am using IMAP4 client: mailkit.
It does great work, but I have a problem knowing that there are attachments in the message or not.
I have tried:
var summary = inbox.fet (message id, message notification body, cancel token) .FirstOrDefault (); Var body multipart = summary. As BodyParty Multipart; If (BodyMulti Part = Faucet) {foreach (Body Multipart. Participate in bodyparts, where (x => is bodypartic bassic)) {BODYPART BASIC BASIC PARTY = BODY PARTY BODYpartBassic like; If (Basic Page. Content Disposition! = Null & amp; Basic Page Content Dispute.IsHment) {// Add Original Part as Attachment}}} But some messages (Example : Message content is null .
message notification using Try to do the bodystructure instead of MessageSummaryItems.Body.
Compared to body body, know more information for each body part. I think that the dissection header is one of those extra things, which comes from the body of a body of physiology.
Hope that helps.
Comments
Post a Comment