Basic C # Mime Decoding

Is there a clean way to handle multi-component MIME data in C #.

After calling a closed application (I do not have access to change it) I get a MIME response, like the one below. Does C # provide the ability to parse this through System.Net.Mime or System.Net.Mail?

MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_42_31322961.1286389502467" ------=_Part_42_31322961.1286389502467 Content-Type: text/xml Content-Transfer-Encoding: 7bit Content-ID: <xmlContextInfo> <UnneededXML> <Stuff> </Stuff> </UnneededXML> ------=_Part_42_31322961.1286389502467 Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-ID: <myImage> /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a 

All I really need from the answer is the "myImage" part (which is much longer than shown above).

+5
source share
3 answers

You can use the OpenPOP library, which includes a mime parser.

+4
source
+1
source

MimeKit works well. Earlier, I used Codeplex POP3 MIME Support code, but it could not parse some mimeContent and had to look for alternatives.

0
source