Thursday, 16 November 2017

Setting up DomainKeys Identified Mail (DKIM) email authentication with .Net in 5 minutes

DomainKeys Identified Mail (DKIM) allows e-mail senders to couple their domain name with an e-mail message, thus vouching for its authenticity.

This is achieved by adding a digital signature to the e-mail message header.

Heres how you can do it in .Net.
  1. Add the nuget package to your solution.
  2. Create RSA a key pair at
  3. Add a TXT DNS record for your domain with
    name/host:   default._domainkey
    value:           k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBg QCHhsB36ViuKvPHAgrbVC9MPr9DuquOIseApXB4kLVy/1Hw72Moeqsmyfl M9oXL81bXVpFIU/pBc3GJUL/Fp7Pgp5VTzheelQRfqlFqKL+bt6bTXA1gz1q IAICEctjbnLxzHGbnKiotVXycfckAki01WboyZbdr5wZ 1j6Otco7x9wIDAQAB
    (without newlines copied from step 2)
  4. Add a TXT DNS record for your domain with
    name/host:  _domainkey
    value:         o=~;
  5. In code: 

   var email = new MailMessage("",recipient);
   email.Subject = message.Subject;

   email.Body = message.Body;

   email.IsBodyHtml = true;

   var mailClient = new SmtpClient(strSmtpServer, smtpServerPort) {

      Credentials = new NetworkCredential(strSmtpServerLogin, strSmtpServerPwd)
   var privateKey = PrivateKeySigner.Create(@"-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----"); //with newlines and the RSA PRIVATE KEY header/footer

   var domainKeySigner = new DomainKeySigner(privateKey, "", "default",
       new string[] { "From", "To", "Subject" });

   var dkimSigner = new DkimSigner(privateKey, "", "default",
         new string[] { "From", "To", "Subject" });


and that is it. Now start sending your emails. If you test sending to gmail hopefully you will no longer see the red questionmark to the left of the senders address.

This DKIM solution is implemented on

Monday, 13 November 2017

Benefits of using Wiki's over Office documents

Many businesses around the world still use Microsoft Word, Open Office etc. to edit documents.

Employees typically have Word docs on their computer and send the latest versions on e-mail when needing to share information contained in the document.

Disadvantages of traditional Office documents

  • Cumbersome for people who have previously received documents and now need to find that document by searching their e-mail inbox, local PC file-structure or a network file-share to find the right version. Usually you'll have to search multiple locations because you don't remember where the document is. 
  • People have to make new requests for updated versions of the document.
  • The document author will have to send new versions or send it to new people who also want/should have access to the same information.
  • It is difficult to know if there is information about a topic because these documents are not searchable so you waste time figuring out if information is available somewhere. 
  • Some people will end up doing wasted work because they don't know there is relevant and valuable information available that would affect your work. 
  • Some people will make (costly) mistakes because they don't know that (critical) information is available. 

Advantages of Wiki

  • Maintain a central content repository in one place. Easy and fast access. Everyone knows where to find information.
  • There's a search feature where you can quickly find what you are looking for (no need to look through a directory structure on your own PC etc.).
  • Supports collaboration. Several people can edit the document at the same time.
  • You can add hyperlinks to other wiki pages.
  • You get version history and rollback features.
  • You can comment on someone else's wiki documents.
  • You can get alerts when important / interesting documents are updated.
  • You strengthen innovation capacity in your organization by facilitating sharing of knowledge and ideas.
  • You contribute to an openness culture, which in turn increases employee satisfaction.

When not to use a Wiki 

  • Sensitive and secret information. 
  • Documents to be printed that needs a special layout. 
  • Documents such as contracts that are not to be modified.
  • Documents to be shared with external persons.