Karl Gjertsen

Architect, Developer, Speaker, Bad Golfer,
Raygun brand ambassador and creator of Infiniforms

Monthly Archives: November 2014

Inversion of control in Mail4Net

Inversion of Control All of the Mail4Net client classes implement a common interface, ISmtpClient. This allows you to use the inversion of control pattern with the Mail4Net clients. To demonstrate using IoC with Mail4Net, I have created a sample class called MailCreator class, which has a SendEmail method that takes an email address and then sends an email to that…

Unit testing email code with Mail4Net

When it comes to unit testing your code, Mail4Net provides a great way to test your email sending code. In my previous article, I showed sending an email with Mail4Net. If you are new to Mail4Net, then I would suggest you start with this article. Using the fake client The fake client stores emails that have been sent and they…