The ALPHA release (pre-BETA) of the Cjwdev.Mail class SmtpSender is now ready for public testing and will be available for download within the next couple of days. This is still early days and the code is certainly not ready to be used in any real applications, I am just releasing it in this early form to get feedback and to see if other people can find bugs in it that I have not yet found or anticipated (there will undoubtedly be a fair few of these!). An example of how to use the SmtpSender class can be found below.
Here is a very simple example of how you can use the SmtpSender class (which is the class I have been focusing on, whilst other classes are included in this release I suggest ignoring them for now) once you have added a reference to the SmtpSrv.dll file. Note that the SmtpSrv DLL uses functions from the MxResolver DLL so although your project does not need to directly reference MxResolver.dll, you must make sure you have that DLL in the same folder as SmtpSrv.dll.
Thats it, no need to specify any SMTP server because the application is doing all of the work of an SMTP server itself. What IS required though is a DNS server – if you use the parameterless constructor of SmtpSender as I have done in that example though, the code will automatically pick up the DNS server that your PC is already using. Of course there are overloaded constructors where you can set a specific DNS server as well.
The SendEmail method is actually a function that returns a List(Of SendEmailResult) and as such you can check this list once the method returns to see which of your recipients the code was able to successfully send emails to. Here is an extended example showing how to do this:
I will post another blog post as soon as the download link is available, but be sure to let me know if you have any feedback about the syntax for the SmtpSender class or have any comments on the Cjwdev.Mail library in general.