At the time of this article in October 2015, the HTML swiftmailer module version for Drupal 8 was not released. Thus the below solution is not relevant anymore but may help for configuration or setup. We also have a new post about installation of swiftmailer
Here is a possible solution for sending HTML mails with Drupal 8 specifically when creating custom modules.
The solution below uses Swiftmailer library.
This version needs some corrections if it is used with a recent Drupal 8 release. In this case, these are the lines changed: