<p>I have a project that utilizes the javax.mail.internet.MimeMessage and other related classes that does mime parsing for emails that we receive. This needs to be ported to .NET.</p>

<p>What .Net 3rd party or built in library can I use to replace the Java classes that I'm using?</p>

<p>EDIT: Anything change in the last 9 months since I asked this question?</p>

[{'answer_id': 19103, 'author': 'Ryan Farley', 'author_id': 1627, 'author_profile': 'https://Stackoverflow.com/users/1627', 'pm_score': 3, 'selected': False, 'text': '<p>I\'ve not used javax.mail.internet.MimeMessage, so I can\'t say how any of this compares, but .NET 2.0 and beyond does have a <a href="http://msdn.microsoft.com/en-us/library/system.net.mime.aspx" rel="noreferrer">System.Net.Mime</a> namespace which might have something useful for you.   </p>\n\n<p>Otherwise, I used <a href="http://www.chilkatsoft.com/mime-dotnet.asp" rel="noreferrer">Chilkat MIME .NET</a> a long time ago and was happy with it. </p>\n'}, {'answer_id': 19325, 'author': 'jsight', 'author_id': 1432, 'author_profile': 'https://Stackoverflow.com/users/1432', 'pm_score': 2, 'selected': False, 'text': "<p>I have used both, and concur with Ryan that the System.Net.Mime and sibling namespaces provide very similar functionality.  If anything, I think you'll find that the .Net APIs are cleaner and easier to work with.</p>\n"}, {'answer_id': 118642, 'author': 'Corey Trager', 'author_id': 9328, 'author_profile': 'https://Stackoverflow.com/users/9328', 'pm_score': 3, 'selected': False, 'text': '<p>SharpMimeTools, which is free and open source.</p>\n\n<p><a href="http://anmar.eu.org/projects/sharpmimetools/" rel="noreferrer">http://anmar.eu.org/projects/sharpmimetools/</a></p>\n\n<p>It\'s what I use in my application, <a href="http://ifdefined.com/bugtrackernet.html" rel="noreferrer">BugTracker.NET</a> and it has been very dependable.</p>\n'}, {'answer_id': 1833835, 'author': 'Martin Vobr', 'author_id': 16132, 'author_profile': 'https://Stackoverflow.com/users/16132', 'pm_score': 1, 'selected': False, 'text': '<p>You may try a S/MIME library included in our <a href="http://www.rebex.net/secure-mail.net/" rel="nofollow noreferrer">Rebex Secure Mail</a> component.</p>\n\n<p>Features include:</p>\n\n<ul>\n<li>high level API (MailMessage - as seen in email client)</li>\n<li>low level API (access to a MIME tree)</li>\n<li>autocorrecting code for mangled messages and for messages produced by misbehaving email clients</li>\n<li>ability to read TNEF (aka winmail.dat created by Outlook)</li>\n<li>S/MIME: sign/encrypt/decrypt messages</li>\n<li>supports both .NET and .NET CF</li>\n</ul>\n\n<p>Check <a href="https://www.rebex.net/secure-mail.net/features-mime.aspx" rel="nofollow noreferrer">features</a>, <a href="https://www.rebex.net/secure-mail.net/tutorial-mail-message.aspx" rel="nofollow noreferrer">MailMessage tutorial</a> and <a href="https://www.rebex.net/secure-mail.net/tutorial-mail-secure.aspx" rel="nofollow noreferrer">S/MIME tutorial</a>. You can download it at <a href="https://www.rebex.net/secure-mail.net/" rel="nofollow noreferrer">www.rebex.net/secure-mail.net</a></p>\n'}, {'answer_id': 1923790, 'author': 'Marty', 'author_id': 140497, 'author_profile': 'https://Stackoverflow.com/users/140497', 'pm_score': 2, 'selected': False, 'text': '<p>I am in need of such a library, too.  Looking for a mime processing library.  I need to convert messages and attachments to PDF.<br>\nHere are some of the libraries I have found so far.\nOpen Source Libraries:</p>\n\n<ul>\n<li><a href="http://anmar.eu.org/projects/sharpmimetools/" rel="nofollow noreferrer">SharpMime.NET</a></li>\n</ul>\n\n<p>Commercial Libraries:</p>\n\n<ul>\n<li>Mime4Net</li>\n<li>Rebex</li>\n<li>Chilkat</li>\n<li>Aspose - the most expensive option that I see.</li>\n</ul>\n\n<p>(would have added more links, but my account level prevents me from doing so)</p>\n\n<p>I am still sorting through these, and have not tried one yet.  Probably gonna start with SharpMime since it\'s open source.  Mime4Net has some examples on their site.  From what I see, none of these offer the the conversion to PDF that I am needing, but there are other libraries I am looking at to fulfill that task.</p>\n'}, {'answer_id': 2644678, 'author': 'Pawel Lesnikowski', 'author_id': 80894, 'author_profile': 'https://Stackoverflow.com/users/80894', 'pm_score': 0, 'selected': False, 'text': '<p>Try using <a href="http://www.limilabs.com/mail/" rel="nofollow noreferrer">Mail.dll IMAP component</a>, it\'s on the market for quite a while, and is well tested.</p>\n\n<pre><code>using(Imap imap = new Imap())\n{\n    imap.Connect("imapServer");\n    imap.UseBestLogin("user", "password");\n\n    imap.SelectInbox();\n    List&lt;long&gt; uids = imap.SearchFlag(Flag.Unseen);\n\n    foreach (long uid in uids)\n    {\n        byte[] eml = imap.GetMessageByUID(uid);\n        IMail message = new MailBuilder()\n            .CreateFromEml(eml);\n\n        Console.WriteLine(message.Subject);\n    }\n    imap.Close();\n}\n</code></pre>\n\n<p>Please note that Mail.dll is a commercial product that I\'ve created.</p>\n\n<p>You can download it here: <a href="http://www.limilabs.com/mail/" rel="nofollow noreferrer">http://www.limilabs.com/mail</a>.</p>\n'}, {'answer_id': 21640596, 'author': 'jstedfast', 'author_id': 87117, 'author_profile': 'https://Stackoverflow.com/users/87117', 'pm_score': 4, 'selected': False, 'text': '<p>I\'ve recently released <a href="https://github.com/jstedfast/MimeKit">MimeKit</a> which is far more robust than any of the other open source .NET MIME parser libraries out there and it\'s orders of magnitude faster as well due to the fact that it is an actual stream parser and not a recursive descent string parser (which also has the added benefit of it using a LOT less memory).</p>\n\n<p>It has full support for S/MIME v3.2 (including compression, which none of the other libraries that claim "full" support actually support) and OpenPGP.</p>\n\n<p>For SMTP, POP3, and IMAP you can use my <a href="https://github.com/jstedfast/MailKit">MailKit</a> library which supports a bunch of SASL authentication mechanisms including XOAUTH2 (used by Google). The SMTP client supports PIPELINING which can improve performance of sending mail and the IMAP client supports a growing number of extensions that allow clients to optimize their bandwidth as well.</p>\n'}]
['https://Stackoverflow.com/questions/19096', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1463/']