Fionn
Fionn

Reputation: 11265

SMTP and IMAP server library for .NET

Does anyone know a good SMTP/IMAP server library for C#?

I only found some long abandoned projects.


Only SERVER SIDE libraries, please no more posts about client libs.

Thanks, Fionn

Upvotes: 19

Views: 15909

Answers (6)

rklec
rklec

Reputation: 319

Also found https://github.com/cosullivan/SmtpServer, which seems to be a modern implementation of an SMTP (though no IMAP support):

SmtpServer is a simple, but highly functional SMTP server implementation. Written entirely in C# it takes full advantage of the .NET TPL to achieve maximum performance.

https://github.com/cosullivan/SmtpServer?tab=readme-ov-file

Upvotes: 0

Corey Trager
Corey Trager

Reputation: 23131

For SMTP, there's System.Net.Mail. For IMAP, I don't know. But once you fetch the email from the server, you'll want to parse it. The MIME parsing is the hard part. For that, I use, and recommend, SharpMimeTools.

Upvotes: -1

Hugh Jeffner
Hugh Jeffner

Reputation: 2946

I am working on a project where I need to receive a mail via SMTP on the local network (a legacy application is sending a mail for integration purposes). Originally, I was going to use the SMTP server in IIS and use event sinks but that seems a little heavy-handed. I am currently evaluating the following 3 candidate libraries:

nDumbster: Open source but not a fully-implemented server. Originally used for unit tests. It parses the mail to an object for easy inspection. I had to revise it to raise an event when a message was received.

SmtpServer: Modern design using .NET TPL and Implements STARTTLS. Source code does not seem readily available. Provides a few hooks when message is received but appears to hand you the message contents as a blob. (I didn't get to test this as it requires .net 4.5)

Rnwood.SmtpServer: Looks to be full-featured and source code is available although documentation is lacking.

Upvotes: 4

Stefan Schultze
Stefan Schultze

Reputation: 9388

LumiSoft.Net, a library from the LumiSoft mail server, is a free server side library. The server classes (e.g. IMAP Server, POP3 Server and SMTP Server) fire events when they need information or action for your server application, for example "give me a list of messages in virtual folder XXY".

Download Page

Upvotes: 14

John Lemp
John Lemp

Reputation: 5067

You didn't mention whether you are looking for free or paid/commercial. I have used IPWorks from nsoftware with great success in the past.

Upvotes: 1

cstick
cstick

Reputation: 374

I've used DotNetOpenMail in the past.

Upvotes: 1

Related Questions