DnSmtp – A .NET SMTP Client Library

11:19 AM j. montgomery 0 Comments

Related to my recently released DNS Client library, DnDns, I’ve finally gotten around to releasing a SMTP client library.
This SMTP library provides basic SMTP functionality – it’s able to deliver emails with multiple text mime parts and a few different types of attachments – adding additional attachment types via code should be trivial.
The one main benefit DnSmtp provides over the native .NET Mail implementation is the ability to deliver mail messages directly to the recipient’s email server. It does this by doing an MX lookup (using DnDns) on the email recipient’s domain name and then connects directly to that server to deliver the message. This, in some cases, can provide additional verification of whether an email was successfully delivered to the destination.  This doesn’t work in all cases though -some email systems, like qmail, accept all email messages and then bounce them back if the account doesn’t exist locally.
One area where it falls short from the .NET 2.0 implementation is the ability to encrypt emails.  This is a feature I’d like to eventually add, time permitting.
This SMTP library was originally conceived back in 2001 when we needed to send email from one of our web servers – and we discovered we needed to install Outlook in order to get the .NET 1.1. email functions to work properly, apparently MS decided to have code dependencies that weren’t included in the OS – they have since fixed this in .NET 2.0.  I had some spare time so I started putting this library together. It’s gone through a couple iterations since them, but it’s mostly the same at its core. Since this library is around 8 years old, it’s a bit rough around the edges and looking at it again, I can see many areas for improvement as well as new important features to add.
For now, I have released it as is on CodePlex under the New BSD license. As time permits, I hope make some enhancements to it.
If you happen to use DnSmtp, please report any bugs and/or feature enhancements to the DnSmtp CodePlex site. You can download the source or binary dll here:
DnSmtp – A .NET SMTP Client Library
You’ll also need the DnDns library - DnSmtp is dependent on it.